Changes between Initial Version and Version 3 of Ticket #25752


Ignore:
Timestamp:
Nov 13, 2015, 10:13:33 AM (8 years ago)
Author:
skyjur
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25752

    • Property Type UncategorizedBug
  • Ticket #25752 – Description

    initial v3  
    1 When in migrations I do RenameField on ManyToMany field, and then do AddField with ManyToMany with same name but different model, I get Integrity Error referring to existing index.
     1Given I have a field
    22
    3 It seems the problem is that RenameField does not rename database indexes, and then when new m2m field is being added it tries to create index with same name and so I get database error:
     3{{{
     4   many = ManyToManyField()
     5}}}
     6
     7I create a migration:
     8
     9{{{
     10   RenameField: "many" to "many_legacy"
     11   Create Field: "many" as ManyToManyField()
     12}}}
     13
     14When I run the migration I get:
    415
    516{{{
     
    1425}}}
    1526
    16 Here is how migration which creates this error looks like:
     27
     28It seems the problem is that RenameField does not rename database indexes, and then when new m2m field is being added it tries to create index with same name and so I get database error.
     29
     30Here is full migration code which throws this error:
    1731
    1832{{{
Back to Top