Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to provide and update migrations #19

Open
tpendragon opened this issue Jan 31, 2019 · 4 comments
Open

Find a way to provide and update migrations #19

tpendragon opened this issue Jan 31, 2019 · 4 comments

Comments

@tpendragon
Copy link
Contributor

No description provided.

@no-reply
Copy link

what are the requirements for this?

is this just a generator for https://github.com/samvera-labs/valkyrie-sequel/blob/26fddaf50045cb6c83d43c8699b1f56f7aa72895/db/migrations/001_create_orm_resources.rb, or is something more needed?

@tpendragon
Copy link
Contributor Author

tpendragon commented Oct 20, 2021

The real issue is how to run those migrations against a given database configuration, I think.

For instance - right now our test setup does

METADATA_ADAPTER.reset_database!

which then does

def perform_migrations!
Sequel.extension :migration
Sequel::Migrator.run(connection, "#{__dir__}/../../../db/migrations")
end
def reset_database!
Sequel.extension :migration
Sequel::Migrator.run(connection, "#{__dir__}/../../../db/migrations", target: 0)
perform_migrations!
end

but I sort of doubt that's actually the process we want? Like what if folks want to run their own migrations? Is it sufficient to add to the readme somewhere, "as part of deployment call #perform_migrations! on your metadata adapter"?

Normally I'd test this in Figgy, but we actually have quite a few custom indexes and such and we migrated from the AR adapter to Sequel, so it's just running off all the old AR migrations.

@no-reply
Copy link

no-reply commented Oct 20, 2021

isn't it sufficient to point to sequel -m?

EDIT: comet does https://gitlab.com/surfliner/surfliner/-/blob/trunk/comet/scripts/db-migrate-seed.sh#L7

@tpendragon
Copy link
Contributor Author

I didn't know sequel -m existed! So maybe we just need a way to copy migrations locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants