-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Exposing upToRun and downToRun without actually running migrations #551
Comments
Doesn't --dry-run do exactly what you search for? |
Or is it just about the number? |
Hmmmm I'm not sure TBH; I've not used --dry-run before. A quick bug report for something I came across when trying --dry-run out:
fails on
I'm not actually sure what the intended behavior of that last snippet is. If I change it to If I just nuke that last snippet entirely I feel like we're making solid progress here though, thanks for your help |
Mh, gonna have a look at that. So you really just want to now if there are any migrations to execute and not the number of them? |
Yup pretty much. edit: though I think generally erring on the side of exposing more info better than exposing less. You can always turn a list of migrations to run into a boolean / count, but can't go the other way... |
In that case sounds pretty much the same as #186, but some extended functionality. I could think of a command like check or something like that, that throws out a list of migrations to be executed by the command specified and in case of up migrations the already executed ones and the ones in plan. So for the cli something like
For the programmable interface, I would think of something like that, which could make sense.
If you're willing to contribute a PR that would be awesome! |
cool I should be able to look at it next week :) |
I'm submitting a...
Current behavior
Currently there is no ability to see what migrations will be run without actually running those migrations.
Expected behavior
Additional runnable commands
upToRun
anddownToRun
.What is the motivation / use case for changing the behavior?
When deploying, we want to validate our data after running migrations. Doing so efficiently requires some amount of work (hashing collections) prior to running migrations. Given that most of the time we won't actually have any migrations to run, it would be extremely helpful if there was a method of knowing beforehand how many migrations will run so that we don't have to do this pre-computation.
I'm happy to work on a PR for this but am hoping not to maintain a separate fork. Assuming it met your quality standards, would you open to considering a PR for this functionality?
The text was updated successfully, but these errors were encountered: