From 088644a80b18d6b579b93ae6cd4ccdc63816dc69 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 29 Apr 2012 12:08:44 -0500 Subject: [PATCH] Deprecate ./bin/gmg migrate. Keeping it around just in case someone manually wants to migrate before running the convert thing or... something. Probably silly. --- mediagoblin/gmg_commands/__init__.py | 3 ++- mediagoblin/gmg_commands/migrate.py | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) 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( -- 2.25.1