-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Interest for migration batches? #1338
Comments
Given that the table storing executed migrations stores the timestamp when migrations have been executed, you can already identify which versions have been executed later than the deployment 1 based on it. Do we actually need a new concept of batches (that won't have any benefits except for rollbacks) ? |
Right, that's why I'm asking. Apparently, Laravel implemented migration tracking of "batches", which is kinda this feature. While timestamps allow for introspection, they don't really allow for automation, do they? 🤔 |
I personally do not like the concept of reverting migrations as well... but lets discuss it and see what it comes out it it. I think that timestamps are ok but do not allow to do much. What about something as this:
But this two feature will allow us now to use This are "generic" features but might allow you to handle batch reverts... as example to revert 2-3 deployments backward. I do not like |
@goetas as long as a rollback can somehow be automated, this seems fine to me: we could implement a dedicated flag for it in a PR, and then decide to either rename or discard it. |
In the last two years the time i could invest in open source has been very limited. I might be able to review the code if anything proposed here gets published, but sadly can't do more :( |
@goetas that is fine: I'm trying to throw paid developers at this problem anyway :) Same situation for me, BTW. |
Feature Request
Disclaimer: I don't like rollbacks, and I'm a proponent of fail-forward strategies, but this feature comes out of needs of a third party asking me to put it in cleaner words.
Summary
In the context of a deployment, multiple DB migrations may be executed in a single
migrations:migrate
.Let's assume we have these migrations defined over time
Version111AddUniqueIndexToUsersTable
Version222AddSearchIndexToUsersTable
Version333AddUserActiveFlag
Let's say that we have these deployments happening, each running zero or more migrations:
Version111AddUniqueIndexToUsersTable
Version222AddSearchIndexToUsersTable
Version333AddUserActiveFlag
If we want to roll back from
deployment 2
todeployment 1
, a deployment tool would need to know that it needs to migrate toVersion111AddUniqueIndexToUsersTable
.This means that the person or automation triggering the migration towards
Version111AddUniqueIndexToUsersTable
needs some contextual information on which deployments happened previously.I'm wondering if there's interest in grouping executed migrations by batch, allowing to therefore do rollbacks like
--prev-batch
(rather than--prev
).The text was updated successfully, but these errors were encountered: