If the constraint already exists, roll back to a sane state.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 8 Aug 2014 14:50:16 +0000 (09:50 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 8 Aug 2014 14:50:16 +0000 (09:50 -0500)
mediagoblin/db/migrations.py

index a7e026c696ae7b9ca726fb73b926db4106a08114..fca7819bddadc736ca34eddc22eb60b38e8d072f 100644 (file)
@@ -883,6 +883,6 @@ def revert_username_index(db):
             constraint.create()
         except ProgrammingError:
             # constraint already exists, no need to add
-            pass
+            db.rollback()
 
     db.commit()