From: Christopher Allan Webber Date: Sun, 29 Apr 2012 17:08:44 +0000 (-0500) Subject: Deprecate ./bin/gmg migrate. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=088644a80b18d6b579b93ae6cd4ccdc63816dc69;p=mediagoblin.git Deprecate ./bin/gmg migrate. Keeping it around just in case someone manually wants to migrate before running the convert thing or... something. Probably silly. --- diff --git a/mediagoblin/gmg_commands/__init__.py b/mediagoblin/gmg_commands/__init__.py index 85bab510..4a608a69 100644 --- a/mediagoblin/gmg_commands/__init__.py +++ b/mediagoblin/gmg_commands/__init__.py @@ -28,7 +28,8 @@ SUBCOMMAND_MAP = { 'migrate': { 'setup': 'mediagoblin.gmg_commands.migrate:migrate_parser_setup', 'func': 'mediagoblin.gmg_commands.migrate:migrate', - 'help': 'Apply all unapplied bulk migrations to the database'}, + 'help': ('Migrate your Mongo database. ' + '[DEPRECATED!] use convert_mongo_to_sql and dbupdate.')}, 'adduser': { 'setup': 'mediagoblin.gmg_commands.users:adduser_parser_setup', 'func': 'mediagoblin.gmg_commands.users:adduser', diff --git a/mediagoblin/gmg_commands/migrate.py b/mediagoblin/gmg_commands/migrate.py index af541786..b915a528 100644 --- a/mediagoblin/gmg_commands/migrate.py +++ b/mediagoblin/gmg_commands/migrate.py @@ -16,13 +16,8 @@ import sys -from mediagoblin.db.mongo import util as db_util -from mediagoblin.db.mongo.open import setup_connection_and_db_from_config from mediagoblin.init import setup_global_and_app_config -# This MUST be imported so as to set up the appropriate migrations! -from mediagoblin.db.mongo import migrations - def migrate_parser_setup(subparser): pass @@ -45,6 +40,12 @@ def migrate(args): def run_migrate(conf_file): + # This MUST be imported so as to set up the appropriate migrations! + from mediagoblin.db.mongo import migrations + + from mediagoblin.db.mongo import util as db_util + from mediagoblin.db.mongo.open import setup_connection_and_db_from_config + global_config, app_config = setup_global_and_app_config(conf_file) connection, db = setup_connection_and_db_from_config(