Commits

Anonymous committed d5f483a

Use predictable names, actually. Also, commit [200]!

  • Participants
  • Parent commits 4e7ddf8

Comments (0)

Files changed (2)

File south/db/generic.py

         if not isinstance(columns, (list, tuple)):
             columns = [columns]
         
-        name = "south_unique_" + "".join(random.choice(string.letters) for i in range(16))
+        name = self.create_index_name(table_name, columns)
         
         cols = ", ".join(map(qn, columns))
         self.execute("ALTER TABLE %s ADD CONSTRAINT %s UNIQUE (%s)" % (qn(table_name), qn(name), cols))

File south/tests/db.py

         # Delete them both
         db.delete_index("test3", ["SELECT"])
         db.delete_index("test3", ["SELECT", "eggs"])
-        # Delete the unique index
-        db.delete_index("test3", ["eggs"])
+        # Delete the unique index/constraint
+        db.delete_unique("test3", ["eggs"])
         db.rollback_transaction()
         db.delete_table("test3")