aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-01-02 09:12:11 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-01-29 16:33:45 -0600
commitb0ec21bff3fd01dc5e1d217560ca6479aadaae8b (patch)
tree49a14ca3a93d9ed1ec2dc16116524008c026adfe
parent8bf3f63af14152099d653e426aa22c1c4e487943 (diff)
downloadmediagoblin-b0ec21bff3fd01dc5e1d217560ca6479aadaae8b.tar.lz
mediagoblin-b0ec21bff3fd01dc5e1d217560ca6479aadaae8b.tar.xz
mediagoblin-b0ec21bff3fd01dc5e1d217560ca6479aadaae8b.zip
Add create_new_migration_record method to MigrationManager
-rw-r--r--mediagoblin/db/sql/util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mediagoblin/db/sql/util.py b/mediagoblin/db/sql/util.py
index 59e8eb8b..a42d992f 100644
--- a/mediagoblin/db/sql/util.py
+++ b/mediagoblin/db/sql/util.py
@@ -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):
"""