pdf: remove two unused files (we use pdf.js in an iframe, no need for our own bastard...
[mediagoblin.git] / mediagoblin / gmg_commands / dbupdate.py
index 65b3f922feaa454258ce5abb0ecda6f2891c8bde..fa25ecb2f605c457c6988549afb3ba98c5d0af5b 100644 (file)
@@ -78,6 +78,7 @@ def gather_database_data(media_types, plugins):
         except AttributeError as exc:
             _log.warning('Could not find MODELS in {0}.models, have you \
 forgotten to add it? ({1})'.format(plugin, exc))
+            models = []
 
         try:
             migrations = import_component('{0}.migrations:MIGRATIONS'.format(
@@ -91,6 +92,7 @@ forgotten to add it? ({1})'.format(plugin, exc))
         except AttributeError as exc:
             _log.debug('Cloud not find MIGRATIONS in {0}.migrations, have you \
 forgotten to add it? ({1})'.format(plugin, exc))
+            migrations = {}
 
         if models:
             managed_dbdata.append(
@@ -114,7 +116,7 @@ def run_dbupdate(app_config, global_config):
             global_config.get('plugins', {}).keys())
 
     # Set up the database
-    db = setup_connection_and_db_from_config(app_config)
+    db = setup_connection_and_db_from_config(app_config, migrations=True)
 
     Session = sessionmaker(bind=db.engine)