Skip to content
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

Don't revert migrations that are no longer in the list of migrations to apply #41

Merged
merged 3 commits into from
Mar 8, 2025

Conversation

adam-fowler
Copy link
Member

@adam-fowler adam-fowler commented Feb 25, 2025

Up to this point when running a migration it would remove any migrations found after an inconsistency was found in the list of migrations. This is far too aggressive and could lead to lost data. Instead in this PR we throw an error if an inconsistency is found and provide a list to compare the migrations setup in the application and the list of applied migrations.

To remove migrations added during development a new function DatabaseMigrations.revertInconsistent() has been added. This will revert any migration found after an inconsistency in the lists.

Add specific function to do this `revertInconsistent`.
@adam-fowler adam-fowler merged commit 4ead82f into main Mar 8, 2025
11 of 12 checks passed
@adam-fowler adam-fowler deleted the inconsistent-migrations branch March 8, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants