• 
      

    Fix issues with setting and removing unique_together in one transaction.

    Review Request #6141 — Created July 24, 2014 and submitted — Latest diff uploaded

    Information

    Django Evolution
    master
    bf04ab5...

    Reviewers

    The code for generating unique_together indexes failed to set a valid
    name, which was fine so long as that index wasn't being set twice in the
    same transaction.

    With this bug, setting a unique_together and then changing it would
    result in the SQL for index creation happening more than once.

    It also didn't filter out no-op index creation/removals, which was
    actually a problem for Postgres.

    Now, we do a better job of filtering out unnecessary index operations
    and also dealing with indexes that were created within that transaction.

    Unit tests pass.

    I hit this problem in production. This patch fixed it.