diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-07-03 14:07:11 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-07-03 14:07:11 -0500 |
commit | 41a14c6efc1dd9cfc36f1b2eb4cb3f3b34e4d975 (patch) | |
tree | 52fee3564663e94c7d30c588156fe8c20b7b8c25 /mediagoblin/gmg_commands/dbupdate.py | |
parent | 87bca496b28ec9b98144747767bb1c8e8dec4676 (diff) | |
parent | 6db23bd9b6cb9198a516065988d64c5322f9f175 (diff) | |
download | mediagoblin-41a14c6efc1dd9cfc36f1b2eb4cb3f3b34e4d975.tar.lz mediagoblin-41a14c6efc1dd9cfc36f1b2eb4cb3f3b34e4d975.tar.xz mediagoblin-41a14c6efc1dd9cfc36f1b2eb4cb3f3b34e4d975.zip |
Merge remote-tracking branch 'remotes/lotusecho/trac_711_test_speed'
Diffstat (limited to 'mediagoblin/gmg_commands/dbupdate.py')
-rw-r--r-- | mediagoblin/gmg_commands/dbupdate.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mediagoblin/gmg_commands/dbupdate.py b/mediagoblin/gmg_commands/dbupdate.py index fa25ecb2..22ad426c 100644 --- a/mediagoblin/gmg_commands/dbupdate.py +++ b/mediagoblin/gmg_commands/dbupdate.py @@ -110,14 +110,26 @@ def run_dbupdate(app_config, global_config): in the future, plugins) """ + # Set up the database + db = setup_connection_and_db_from_config(app_config, migrations=True) + #Run the migrations + run_all_migrations(db, app_config, global_config) + + +def run_all_migrations(db, app_config, global_config): + """ + Initializes or migrates a database that already has a + connection setup and also initializes or migrates all + extensions based on the config files. + + It can be used to initialize an in-memory database for + testing. + """ # Gather information from all media managers / projects dbdatas = gather_database_data( app_config['media_types'], global_config.get('plugins', {}).keys()) - # Set up the database - db = setup_connection_and_db_from_config(app_config, migrations=True) - Session = sessionmaker(bind=db.engine) # Setup media managers for all dbdata, run init/migrate and print info |