Commits

Reed Sandberg committed 7b6cdb6

limited column set. A describe on the table definition showed two unique
constraints - the old and new, with the old one (of course) being the limited
case. While tracing the migration with verbose output, I noticed South
re-creates the table for sqlite3 and instead of creating one new (correct)
unique index, it created both the existing (which was to be replaced) and the
new index. Digging into the source code, I see that for sqlite3, delete_unique
is triggered by a comparison based on order of fields that make up a unique
index (using a list comparison) whereas it should simply be based on the unique
set of elements (using set()).

  • Participants
  • Parent commits ea94970

Comments (0)

Files changed (1)

south/db/sqlite3.py

                     name = renames[name]
                 columns.append(name)
 
-            if columns and columns != uniques_deleted:
+            if columns and set(columns) != set(uniques_deleted):
                 self._create_unique(table_name, columns)
     
     def _column_sql_for_create(self, table_name, name, field, explicit_name=True):