aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-07-10 18:43:08 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-07-10 18:43:08 -0500
commit9cf8b469e7f8e4fea581875637c16025e75550d4 (patch)
tree728df07330599c0969f210cefbf407f898a52241
parent1b38cfa3b7a208a0af995c082fc0998cd0099996 (diff)
downloadmediagoblin-9cf8b469e7f8e4fea581875637c16025e75550d4.tar.lz
mediagoblin-9cf8b469e7f8e4fea581875637c16025e75550d4.tar.xz
mediagoblin-9cf8b469e7f8e4fea581875637c16025e75550d4.zip
Move the call to install_migration_version_if_missing() to migrations_to_run()
This means there's a serious side effect of calling this, but there's no way to get useful data here unless if that's set anyway.
-rw-r--r--mediagoblin/db/util.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py
index 03e896f3..2ca17f0b 100644
--- a/mediagoblin/db/util.py
+++ b/mediagoblin/db/util.py
@@ -231,7 +231,14 @@ class MigrationManager(object):
def migrations_to_run(self):
"""
Get a list of migrations to run still, if any.
+
+ Note that calling this will set your migration version to the
+ latest version if it isn't installed to anything yet!
"""
+ # If we aren't set to any version number, presume we're at the
+ # latest (which means we'll do nothing here...)
+ self.install_migration_version_if_missing()
+
db_current_migration = self.database_current_migration()
return [
@@ -251,11 +258,6 @@ class MigrationManager(object):
run post-migration. Takes (migration_number, migration_func)
as arguments
"""
- # If we aren't set to any version number, presume we're at the
- # latest (which means we'll do nothing here...)
- # @@: should this be in migrations_to_run()?
- self.install_migration_version_if_missing()
-
for migration_number, migration_func in self.migrations_to_run():
if pre_callback:
pre_callback(migration_number, migration_func)