Fix the create_moderation_tables migration to work with postgresql
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 10 Oct 2013 16:28:59 +0000 (11:28 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 10 Oct 2013 16:28:59 +0000 (11:28 -0500)
Was comparing/assigning to integers... but that's not how postgres rolls!

mediagoblin/db/migrations.py

index a1a7c576b52f1e311f80fa8cc1cc9c941f560f6f..21effa66a74dc66b8425fa7ddeb8ab0e9bd1333e 100644 (file)
@@ -634,14 +634,14 @@ def create_moderation_tables(db):
     admin_users_ids, active_users_ids, inactive_users_ids = (
         db.execute(
             user_table.select().where(
-                user_table.c.is_admin==1)).fetchall(),
+                user_table.c.is_admin==True)).fetchall(),
         db.execute(
             user_table.select().where(
-                user_table.c.is_admin==0).where(
+                user_table.c.is_admin==False).where(
                 user_table.c.status==u"active")).fetchall(),
         db.execute(
             user_table.select().where(
-                user_table.c.is_admin==0).where(
+                user_table.c.is_admin==False).where(
                 user_table.c.status!=u"active")).fetchall())
 
     # Get the ids for each of the privileges so we can reference them ~~~~~~~~~