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

chore: remove replaces sections from squashing migrations. #2261

Merged

Conversation

pwnage101
Copy link
Contributor

@pwnage101 pwnage101 commented Oct 8, 2024

This enables --prune to function and actually delete old records in the migrations table.

(edxapp) www-data@ip-10-3-10-206:/edx/app/edxapp/edx-platform$ ./manage.py lms migrate --prune
...
CommandError: Migrations can be pruned only when an app is specified.
...
(edxapp) www-data@ip-10-3-10-206:/edx/app/edxapp/edx-platform$ ./manage.py lms migrate enterprise --prune
...
Pruning migrations:
  Cannot use --prune because the following squashed migrations have their 'replaces' attributes and may not be recorded as applied:
    social_django.0001_initial
    social_django.0004_auto_20160423_0400
    social_django.0005_auto_20160727_2333
    social_django.0002_add_related_name
    social_django.0003_alter_email_max_length
    sap_success_factors.0004_auto_20220324_1550_squashed_0006_auto_20220330_1157
    sap_success_factors.0001_squashed_0022_auto_20200206_1046_squashed_0011_alter_sapsuccessfactorslearnerdatatransmissionaudit_enterprise_course_enrollment_id
    blackboard.0001_initial_squashed_0014_alter_blackboardlearnerassessmentdatatransmissionaudit_enterprise_course_enrollment_id
  Re-run 'manage.py migrate' if they are not marked as applied, and remove 'replaces' attributes in their Migration classes.

This enables --prune to function and actually delete old records in the
migrations table.
@pwnage101 pwnage101 merged commit 640e711 into master Oct 8, 2024
12 checks passed
@pwnage101 pwnage101 deleted the pwnage101/remove-replaces-from-squashed-migrations branch October 8, 2024 16:46
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.

3 participants