Add create_new_migration_record method to MigrationManager
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 2 Jan 2012 15:12:11 +0000 (09:12 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 29 Jan 2012 22:33:45 +0000 (16:33 -0600)
mediagoblin/db/sql/util.py

index 59e8eb8bd2f87e9730e3c8f1380e6f4108d8fbf0..a42d992f04240142708a0c8bbfa10b76b5a2d01a 100644 (file)
@@ -126,6 +126,7 @@ class MigrationManager(object):
         """
         # sanity check before we proceed, none of these should be created
         for model in self.models:
+            # Maybe in the future just print out a "Yikes!" or something?
             assert not model.__table__.exists(self.database)
 
         self.migration_model.metadata.create_all(
@@ -133,8 +134,12 @@ class MigrationManager(object):
             tables=[model.__table__ for model in self.models])
 
     def create_new_migration_record(self):
-        ## TODO
-        pass
+        """
+        Create a new migration record for this migration set
+        """
+        self.migration_model(
+            name=self.name,
+            version=self.latest_migration())
 
     def dry_run(self):
         """