Remove replaces from squashed migrations#900
Merged
nijel merged 1 commit intopython-social-auth:masterfrom Feb 5, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #900 +/- ##
==========================================
- Coverage 93.33% 93.30% -0.03%
==========================================
Files 42 42
Lines 1350 1345 -5
Branches 62 62
==========================================
- Hits 1260 1255 -5
Misses 67 67
Partials 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Merged, thanks for your contribution! |
This file contains hidden or 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
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.
Description
This PR removes the
replacesattribute from squashed migrations 0001-0005, resolving the issue where Django'smigrate --prunecommand fails.Fixes #899
Changes
Removed the
replacesattribute from the following migration files:0001_initial.py0002_add_related_name.py0003_alter_email_max_length.py0004_auto_20160423_0400.py0005_auto_20160727_2333.pyMotivation
These squashed migrations have been in place for several years and are already applied in all production databases. According to Django's migration documentation, once a squashed migration is deployed everywhere, the
replacesattribute should be removed.The presence of these attributes prevents users from running
python manage.py migrate --prune, which is necessary for:Impact
migrate --prunecommand and other migration management operations.Given that these squashed migrations were introduced several years ago, the vast majority of installations should already have them applied.
Testing
python manage.py showmigrationscorrectly shows all migrations as appliedpython manage.py migrate --prunenow runs without errorsChecklist
replacesattributes from squashed migrationsmigrate --pruneusage