From: Christopher Allan Webber Date: Sat, 30 Jul 2011 17:33:57 +0000 (-0500) Subject: Let users know when their migrations are from the future :O X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=482d53cd30229798ff58f9d6f3cbb3b86f94f218;p=mediagoblin.git Let users know when their migrations are from the future :O --- diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py index 64fa9b92..ff005703 100644 --- a/mediagoblin/init/__init__.py +++ b/mediagoblin/init/__init__.py @@ -61,9 +61,16 @@ def setup_database(): # Tiny hack to warn user if our migration is out of date if not migration_manager.database_at_latest_migration(): - print ( - "*WARNING:* Your migrations are out of date, " - "maybe run ./bin/gmg migrate?") + db_migration_num = migration_manager.database_current_migration() + latest_migration_num = migration_manager.latest_migration() + if db_migration_num < latest_migration_num: + print ( + "*WARNING:* Your migrations are out of date, " + "maybe run ./bin/gmg migrate?") + elif db_migration_num > latest_migration_num: + print ( + "*WARNING:* Your migrations are out of date... " + "in fact they appear to be from the future?!") setup_globals( db_connection = connection,