rollback previous working version on ci/ci pipeline in error case #969
Unanswered
lucas-mezencio
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to rollback to a previous working version of the migrations if a new migration fails? I mean, supose that we had deployed some changes to a production database along his api. So we have now more changes with more migrations, and one of them fails, the default behaviour is to stop at the last succed migration, but that is not what I want. I want to stop the API deploy and keep the production database at the last migration version.
Example:
PROD DB is in version 15 of migrations.
Acceptance build to prod will add more 5 migrations changing the prod database to 20. Although, an error ocurred in migration 18, so the prod db will stop in version 17. So, I want to migrate down back to version 15 (so neither the database changes neither the API), but there's no way of track the last version before an migrate up command or revert to the state before the execution.
Then, I want to know how I do this and if is the right way to this deploy pipeline.
Beta Was this translation helpful? Give feedback.
All reactions