aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/util.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-07-09 18:17:54 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-07-09 18:17:54 -0500
commit32ae9e1b4eeb426f31c0a15100fcebe1b353eea4 (patch)
treee56a103b980e5471fd0069f3dafe4bc5bb78fad8 /mediagoblin/db/util.py
parentec86d16a5376168127190aee36dfc8f3e559b527 (diff)
downloadmediagoblin-32ae9e1b4eeb426f31c0a15100fcebe1b353eea4.tar.lz
mediagoblin-32ae9e1b4eeb426f31c0a15100fcebe1b353eea4.tar.xz
mediagoblin-32ae9e1b4eeb426f31c0a15100fcebe1b353eea4.zip
Making sure migration_number > 0 :)
Diffstat (limited to 'mediagoblin/db/util.py')
-rw-r--r--mediagoblin/db/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py
index 5f0699c1..7bae57ff 100644
--- a/mediagoblin/db/util.py
+++ b/mediagoblin/db/util.py
@@ -136,6 +136,8 @@ class RegisterMigration(object):
0. 0 is the default "no migrations" state!
"""
def __init__(self, migration_number, migration_registry=MIGRATIONS):
+ assert migration_number > 0, "Migration number must be > 0!"
+
self.migration_number = migration_number
self.migration_registry = migration_registry
@@ -196,7 +198,7 @@ class MigrationManager(object):
{'$set': {'current_migration': migration_number}},
upsert=True)
- def database_current_migration(self, install_if_missing=True):
+ def database_current_migration(self, install_if_missing=False):
"""
Return the current migration in the database.
"""