Commits

Andrew Godwin committed f7a5b6b

Fix #127 - Wrong order of create/delete_uniques

Comments (0)

Files changed (1)

south/management/commands/startmigration.py

                 cols,
             )
             
-            backwards += DELETE_UNIQUE_SNIPPET % (
+            backwards = DELETE_UNIQUE_SNIPPET % (
                 ", ".join(ut),
                 model._meta.object_name,
                 model._meta.db_table,
                 cols,
-            )
+            ) + backwards
         
         
         ### Deleted unique_togethers ###
             
             cols = [get_field_column(model, f) for f in ut]
             
-            forwards += DELETE_UNIQUE_SNIPPET % (
+            forwards = DELETE_UNIQUE_SNIPPET % (
                 ", ".join(ut),
                 model._meta.object_name,
                 model._meta.db_table,
                 cols,
-            )
+            ) + forwards
             
             backwards += CREATE_UNIQUE_SNIPPET % (
                 ", ".join(ut),