Opened 4 months ago

Closed 3 months ago

#35122 closed Bug (fixed)

--prune should take app_label into account then checking squashed migrations.

Reported by: Moein Bbp Owned by: Moein Bbp
Component: Core (Management commands) Version: 4.2
Severity: Normal Keywords:
Cc: Jacob Walls Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Considering that entering the app label is mandatory when running migrate command with --prune, it is ignored during command execution and some pre-conditions are checked globally.
there are some apps that are actually third-party and we don't have any control on them. if I want to prune migration only for my specific app, I get this error:

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.0003_alter_email_max_length
social_django.0002_add_related_name
social_django.0005_auto_20160727_2333

social_django is a third party app that I don't have any control on that. But in prune command I used orders app this my app. So it seems some preconditions are checking globally instead of checking based on app.

Change History (7)

comment:1 by Mariusz Felisiak, 4 months ago

Cc: Jacob Walls added
Has patch: set
Needs tests: set
Owner: changed from nobody to Moein Bbp
Status: newassigned
Summary: Migrate prune command--prune should take app_label into account then checking squashed migrations.
Triage Stage: UnreviewedAccepted

Thanks for the report.

PR

comment:2 by Natalia Bidart, 4 months ago

Patch needs improvement: set

comment:3 by Moein Bbp, 4 months ago

Needs tests: unset
Patch needs improvement: unset

comment:4 by Mariusz Felisiak, 4 months ago

Needs tests: set

comment:5 by Moein Bbp, 3 months ago

Needs tests: unset

comment:6 by Mariusz Felisiak, 3 months ago

Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 3 months ago

Resolution: fixed
Status: assignedclosed

In cf107fe2:

Fixed #35122 -- Made migrate --prune option respect --app_label.

Note: See TracTickets for help on using tickets.
Back to Top