-
Notifications
You must be signed in to change notification settings - Fork 26
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
Squash / clean up (old) migrations #4973
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Squashed all migrations into a single operation. Requires 2.8.0 to have been run (which is enforced by the upgrade checks). Once 3.0 is released, the original migrations can be removed.
Replaced some RunPython operations that are guaranteed to have been run on Open Forms 2.8.x with empty operations so that we can properly optimize migrations during squashing.
Manually commented out some of the RunPython to hopefully better optimize the squashed migration, and added those operations back in to the squashed migration (mostly the resetting of the default template translations which is a workaround). The update_summary_tags in the original migration now imports the definition from the squashed migration rather than not executing it at all, as some dev-environments might miss this step if they pull master not frequently enough. This migration can be further optimized by hand, see the next commit.
Due to the forward-ports we ended up with multiple merge migrations each overlapping a bit, and 0063 brought them all together. Squashmigrations can only handle a single branch of migrations and left out the forward-ported migrations 0059 and 0062. These can safely be included manually as well, as they basically only update the model state in migrations.
Similar to the config app, migrations were squashed and some merge migrations were involved, but this time Django picked it up correctly. The price logic rules conversion was moved and in the original migration a dynamic import is now used instead to avoid duplicating the implementation.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4973 +/- ##
=======================================
Coverage 96.65% 96.65%
=======================================
Files 762 762
Lines 25935 25935
Branches 3391 3391
=======================================
Hits 25067 25067
Misses 604 604
Partials 264 264 ☔ View full report in Codecov by Sentry. |
The Objects API group config model was moved from the registrations app to the general purpose contrib app for the Objects API, as it is used by both prefill and registration plugins. This involved some dark migrations magic with SeparateDatabaseAndState to move the model without breaking the existing table or messing with table names. Now that we're guaranteed existing instances have upgrade to 2.8, we know that the tables are properly in the right place and the necessary migrations have been executed, allowing us to turn them into normal migrations so that fresh installs can take the direct path rather than the detour, and it allows us to clean up some migration code. The rest of the migrations in the contrib app are not yet squashed, as they are primarly operations around RunPython that need to be executed on 3.0 instances.
Squashed all migrations since 2.3.0 into a single file, optimizing away some in-between states for refactors that happened along the way. RunPython operations have been emptied since they're guaranteed to have run on OF 2.8.x, per the upgrade requirements.
These have never been squashed before. Only the migrations before 3.0 are squashed, as the migrations in 3.0 contain mostly RunPython operations that still need to be executed.
sergei-maertens
force-pushed
the
release/4920-3.0-squash-migrations
branch
from
December 27, 2024 16:17
009eec8
to
a2d8e48
Compare
We require users to be on OF 2.8 before they can upgrade to 3.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of 3.0 release prep, #4920
Changes
RunPython
operations that have run in 2.8Tested on:
master
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Dockerfile/scripts
./bin
folderCommit hygiene