Another db->db.engine because I'm bad at things ;)
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 2 Jan 2012 22:14:55 +0000 (16:14 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 29 Jan 2012 22:33:45 +0000 (16:33 -0600)
Thanks again Elrond.

mediagoblin/db/sql/util.py

index 0911884ebb1e4e966421317a0ae97fac09787259..659765384b4f4fa747403425f7fdf1d5942c8014 100644 (file)
@@ -50,10 +50,10 @@ class MigrationManager(object):
         self.printer = printer
 
         # For convenience
-        from mediagoblin.db.sql.models import MigrationData
+        from mediagoblin.db.sql.models import MigrationRecord
 
-        self.migration_model = MigrationData
-        self.migration_table = MigrationData.__table__
+        self.migration_model = MigrationRecord
+        self.migration_table = MigrationRecord.__table__
 
     @property
     def sorted_migrations(self):
@@ -251,8 +251,8 @@ def assure_migrations_table_setup(db):
     """
     Make sure the migrations table is set up in the database.
     """
-    from mediagoblin.db.sql.models import MigrationData
+    from mediagoblin.db.sql.models import MigrationRecord
 
-    if not MigrationData.__table__.exists(db):
-        MigrationData.metadata.create_all(
-            db, tables=[MigrationData.__table__])
+    if not MigrationRecord.__table__.exists(db.engine):
+        MigrationRecord.metadata.create_all(
+            db, tables=[MigrationRecord.__table__])