Changes between Version 1 and Version 2 of Ticket #34304


Ignore:
Timestamp:
Jan 30, 2023, 10:41:04 AM (23 months ago)
Author:
Sage Abdullah
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34304 – Description

    v1 v2  
    4343
    4444Use case:
    45 [https://github.com/wagtail/wagtail Wagtail] supports multiple database backends. We have a migration that adds a unique constraint to a foreign key with a condition. In addition, we also have migrations that alter the field referenced in the condition. Before making an alter field operation, we need to remove the unique constraint to avoid violating the constraint, then re-add the constraint after the field has been altered. We have more than one migrations that do these operations, thus triggering the error. This issue only happens on MySQL, even specifically after the above commit was merged into Django. Even though conditional indexes aren't supported on MySQL, I believe it should just be ignored (as with previous releases) instead of crashing the schema editor.
     45[https://github.com/wagtail/wagtail Wagtail] supports multiple database backends. We have a migration that adds a unique constraint to a foreign key with a condition. In addition, we also have migrations that alter the field referenced in the condition. Before making an alter field operation, we need to remove the unique constraint to avoid violating the constraint, then re-add the constraint after the field has been altered. We have more than one migrations that do these operations, thus triggering the error. This issue only happens on MySQL, specifically after the above commit was merged into Django. Even though conditional indexes aren't supported on MySQL, I believe it should just be ignored (as with previous releases) instead of crashing the schema editor.
    4646
    4747Relevant migrations in Wagtail:
Back to Top