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


Ignore:
Timestamp:
04/15/2019 01:59:30 PM (8 months ago)
Author:
Arthur Rio
Comment:

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