-
Notifications
You must be signed in to change notification settings - Fork 273
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
specify specific migrations to use #434
base: main
Are you sure you want to change the base?
Conversation
Conflicts: main.go pkg/dbmate/db.go
This PR is updated to allow for multiple migrations to be specified rather than just one. |
#256 for automatically applying multiple migrations at once by specifying one does not satisfy my workflows: I would still have to engage in workarounds. However, someone that wants that functionality can use this PR to apply multiple migrations in one go. It would be possible to add a special syntax to this MR to directly support what is desired in #256. Something like adding a star in front: |
It wouldn't work to use
|
It's not unusual for there to be multiple pending migrations but to want to carefully apply just one.
I have been forced to engage in workarounds like deleting the migration files I don't want to apply (probably most people are putting the migration file they want into a separate directory).
This ignores all other migrations and assumes you are handling dependency management.
There are other migration tools like sqitch that actually track migration dependencies. #256 provides somewhat similar functionality but will assume a dependency chain and apply multiple migrations.
Testing
This was tested manually with
dbmate status
by using the version and the filename and seeing that only one migration showed up. Also tested by using a non-existent version and seeing the error show up.