-
Notifications
You must be signed in to change notification settings - Fork 546
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
Up command don't run all pending migrations #233
Comments
I could create a pull request for this issue and take care of this feature. Are there any preferences about how I should implement it? Do you want me to change the behavior of the "up" command or do you want me to create a new command "up-all"? Another option would be to add a command-line flag to the "up" command. Personally, I'd prefer to change the behavior of the "up" command, since it's the most logical approach for me to always run all pending migrations. But I am not sure whether this would be seen as a breaking change. What do you think? |
What would the performance implications be of modifying the |
I think adding the option up-all or up -a etc would be the safest way to do it. We have also ran into issues when we spin up new environments where we need to run the up command multiple times to get all migrations in, which will scale bad as the migrations keeps increasing, so it would be appreciated to at least have a way for it to always run all migrations. |
Interesting, we've never observed Having said that, we can certainly improve the performance of that For the initial question, I assume you've read why this is not supported, more details here: hybrid-versioning Having said that, over the years this has been the number one requested feature. My proposal is to maintain the existing functionality as the default, call it "strict mode", where migrations behave as they do today. However, give users ability to opt-out of "strict mode" whereby
@VojtechVitek any objections/thoughts? |
In my case, I've only just recently started working on this project which has used timestamp versioning for years, and this prescription is a somewhat bitter pill:
I'm painfully aware that supporting all the multifaceted ways in which users (ab)use an open source project is not the responsibility of its maintainers. To be clear, I'm grateful for the existence of this project in its current form, and I really hope this feedback doesn't come off as stroppy and entitled. But I don't think sequential migration versioning is a complete panacea. Maybe the best way out of this is not to write any code to support a “loose mode” at all, but rather better documentation on how to safely:
“Safely” meaning at least as far as Goose's audit records are concerned, not the contents of the migrations. Out-of-order migrations clearly carry some safety concerns with respect to schema dependencies, and that's reason enough alone to want to avoid applying old ones carelessly. |
Superseded by #262. Closing in favor of that issue. In short, we plan to add support for "apply all migrations, always, even if out-of-order" which will be an opt-in flag. |
Just recently I had an issue where I merged a branch and there was a migration in the merged branch that was older than the migration I had run in my current branch.
So I had missed a migration and had no way of knowing other than goose status.
It would be great to have an option to always run all the pending migrations regardless of whether they are the latest or not.
The text was updated successfully, but these errors were encountered: