From 713dde5b9d002b9257f7079c44214d672ea21463 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 11 Jun 2014 11:09:28 -0500 Subject: [PATCH] Adding comments in the migration explaining a bit what's going on. This commit sponsored by Philip Horger. Thank you! --- mediagoblin/db/migrations.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index 94282f6d..8e0b5096 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -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") -- 2.25.1