Changes between Initial Version and Version 3 of Ticket #29000
- Timestamp:
- Jan 9, 2018, 11:19:47 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29000
- Property Component Uncategorized → Migrations
- Property Type Uncategorized → Bug
- Property Version 1.11 → 2.0
-
Ticket #29000 – Description
initial v3 2 2 3 3 {{{#!python 4 5 4 class ModelA(models.Model): 5 name_renamed = models.CharField(max_length=10) 6 6 7 8 7 class ModelBRenamed(models.Model): 8 a = models.ForeignKey(ModelA, null=True) 9 9 10 11 10 class ModelC(models.Model): 11 b_set = models.ManyToManyField(ModelBRenamed) 12 12 }}} 13 13 … … 49 49 If the two migrations are run together, then the `modelb_id` column in `myapp_modelc_b_set` will not be renamed to `modelbrenamed_id`. However, if I run the migrations one at a time, the column will be renamed as expected. 50 50 51 I think this is related to #27737. When ModelA is reloaded in the RenameField migration, ModelB is reloaded due to it 's foreign key but is missing its relationship to ModelC. When the RenameModel migration is run, ModelC is not included in ModelB's related_objects, so the through table's column is not renamed.51 I think this is related to #27737. When ModelA is reloaded in the RenameField migration, ModelB is reloaded due to its foreign key but is missing its relationship to ModelC. When the RenameModel migration is run, ModelC is not included in ModelB's related_objects, so the through table's column is not renamed. 52 52 53 53 I've reproduced this using Django 1.11 on either MySQL or SQLite.