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

cli: warn if applied and unapplied migrations are being squashed together #8119

Open
rikinsk opened this issue Feb 1, 2022 · 0 comments
Open
Labels
c/cli Related to CLI k/enhancement New feature or improve an existing feature t/product-platform

Comments

@rikinsk
Copy link
Member

rikinsk commented Feb 1, 2022

Is your proposal related to a problem?

In case some of the migrations being squashed are already applied and some are not, post squashing there is no way to apply the missing parts of the squashed migration to the db (other than running the SQL manually of course) and typically will lead to errors in the next migration apply.

Describe the solution you'd like

Allow squashing migrations only if all the involved migrations are either applied or unapplied. In case an inconsistency is observed, raise a warning to the user mentioning the problem this would create. Also suggest the solution, ie. apply the unapplied migrations on the database before squashing. Allow the user to ignore the warning in case they know what they are doing and have reasons to do so

Describe alternatives you've considered

@rikinsk rikinsk added k/enhancement New feature or improve an existing feature c/cli Related to CLI labels Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/cli Related to CLI k/enhancement New feature or improve an existing feature t/product-platform
Projects
None yet
Development

No branches or pull requests

2 participants