Adding comments in the migration explaining a bit what's going on.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 11 Jun 2014 16:09:28 +0000 (11:09 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 11 Jun 2014 16:09:28 +0000 (11:09 -0500)
This commit sponsored by Philip Horger.  Thank you!

mediagoblin/db/migrations.py

index 94282f6d9dac135ce8d43f25daf9982efd86c86f..8e0b5096c9c58cbe84db1236d0694ea399579ca6 100644 (file)
@@ -763,6 +763,7 @@ def fix_privilege_user_association_table(db):
     privilege_user_assoc = inspect_table(
         metadata, 'core__privileges_users')
 
+    # This whole process is more complex if we're dealing with sqlite
     if db.bind.url.drivername == 'sqlite':
         PrivilegeUserAssociation_R1.__table__.create(db.bind)
         db.commit()
@@ -782,6 +783,7 @@ def fix_privilege_user_association_table(db):
         privilege_user_assoc.drop()
         new_privilege_user_assoc.rename('core__privileges_users')
 
+    # much simpler if postgres though!
     else:
         privilege_user_assoc.c.core__user_id.alter(name="privilege")
         privilege_user_assoc.c.core__privilege_id.alter(name="user")