Changes between Version 1 and Version 2 of Ticket #30351, comment 6


Ignore:
Timestamp:
Apr 15, 2019, 1:59:30 PM (5 years ago)
Author:
Arthur Rio

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30351, comment 6

    v1 v2  
    3737}}}
    3838
    39 As you can see, the problem here is that permissions are not cleaned up, so we are left with an existing `| Can add regular then proxy model | add_regularthenproxymodel | regularthenproxymodel |` row. When the 2.2 migration is applied, it tries to create that exact same row, hence the `IntegrityError`. Unfortunately, there is no `remove_stale_permission` management command like the one for `ContentType`. So I think we can do the following:
     39As you can see, the problem here is that permissions are not cleaned up, so we are left with an existing `| Can add regular then proxy model | add_regularthenproxymodel | regularthenproxymodel |` row. When the 2.2 migration is applied, it tries to create that exact same row, hence the `IntegrityError`. Unfortunately, there is no `remove_stale_permission` management command like the one for `ContentType`. So I think we can do one of the following:
    4040
    41411. Show a nice error message to let the user delete the conflicting migration
     42**OR**
    42432. Re-use the existing permission
    4344
Back to Top