Let users know when their migrations are from the future :O

This commit is contained in:
Christopher Allan Webber 2011-07-30 12:33:57 -05:00
parent 50854db05d
commit 482d53cd30

View File

@ -61,9 +61,16 @@ def setup_database():
# Tiny hack to warn user if our migration is out of date # Tiny hack to warn user if our migration is out of date
if not migration_manager.database_at_latest_migration(): if not migration_manager.database_at_latest_migration():
print ( db_migration_num = migration_manager.database_current_migration()
"*WARNING:* Your migrations are out of date, " latest_migration_num = migration_manager.latest_migration()
"maybe run ./bin/gmg migrate?") 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( setup_globals(
db_connection = connection, db_connection = connection,