mozilla/kuma — pull request #48 by lmorchard (2011-11-14 19:10:00+00:00)
Title: 700673 actioncounterunique

Looks like `unique=true` was left out of the previous South migration for actioncounters. This commit adds it.

However, that doesn't help the current situation. Doesn't seem like South has an easy way to add a new unique constraint, and especially not where there are already duplicates in the table.

So, there's also a schematic migration which deletes the duplicate rows and then adds the unique index to the table.

I have one concern about this, and it's that the schematic migration may fail on a new install where the new South migration is run and the unique index gets correctly added. I'm not sure how to address that, or if it's a big deal.