From 6db23bd9b6cb9198a516065988d64c5322f9f175 Mon Sep 17 00:00:00 2001 From: Emily O'Leary Date: Thu, 27 Jun 2013 17:05:25 -0400 Subject: [PATCH] Updated comments for run_all_migrations and config_spec.ini. --- mediagoblin/config_spec.ini | 5 ++++- mediagoblin/gmg_commands/dbupdate.py | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index 6b94901b..12af2f57 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -10,8 +10,11 @@ media_types = string_list(default=list("mediagoblin.media_types.image")) # database stuff sql_engine = string(default="sqlite:///%(here)s/mediagoblin.db") -# Flag used during testing to determine if migrations should be run before the ORM is loaded + +# This flag is used during testing to allow use of in-memory SQLite +# databases. It is not recommended to be used on a running instance. run_migrations = boolean(default=False) + # Where temporary files used in processing and etc are kept workbench_path = string(default="%(here)s/user_dev/media/workbench") diff --git a/mediagoblin/gmg_commands/dbupdate.py b/mediagoblin/gmg_commands/dbupdate.py index 1d9bbf1e..22ad426c 100644 --- a/mediagoblin/gmg_commands/dbupdate.py +++ b/mediagoblin/gmg_commands/dbupdate.py @@ -118,8 +118,12 @@ def run_dbupdate(app_config, global_config): def run_all_migrations(db, app_config, global_config): """ - Moved the migration part of run_dbupdate to a separate function so - it can be used to initialize the database during tests. + 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( -- 2.25.1