Explaining why we're committing mid-migration
authorChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 8 Aug 2014 14:47:33 +0000 (09:47 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 8 Aug 2014 14:47:33 +0000 (09:47 -0500)
mediagoblin/db/migrations.py

index 6ca10b57ae63950d809ac4fd3cda8ed7543d1a5d..a7e026c696ae7b9ca726fb73b926db4106a08114 100644 (file)
@@ -870,6 +870,10 @@ def revert_username_index(db):
         if u'ix_core__users_username' in indexes:
             index = indexes[u'ix_core__users_username']
             index.drop()
+
+        # Given we're removing indexes then adding a unique constraint
+        # which *we know might fail*, thus probably rolling back the
+        # session, let's commit here.
         db.commit()
 
         try: