Opened 11 years ago
Last modified 16 months ago
#23790 closed Bug
Possible bad interaction between migration dependencies and relabeling apps — at Version 2
| Reported by: | Aymeric Augustin | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 1.7 |
| Severity: | Normal | Keywords: | |
| Cc: | info+coding@…, Ryan Cheley | 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 (last modified by )
As far as I can tell, in migrations, dependencies is a list of (app_label, migration_name).
I'm wondering what happens if one relabels an application with AppConfig.label. How can migrations handle this case?
(I haven't tried to create such a problem. I'm just making a note before I forget.)
Change History (2)
comment:1 by , 11 years ago
| Cc: | added |
|---|---|
| Description: | modified (diff) |
comment:2 by , 11 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.
It partially works. If there are no migrations for an app yet, all migrations will be created with the changed label in the dependencies and all places it's being referenced. But as soon as you already have existing migrations and then change the label of an app, the
makemigrationscommand blows up with:The only way I can think of is using the
appconfig.nameattribute instead ofappconfig.label. But that's hard to find a smooth migration path.