Making alembic happen with python 3 only... for now.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 22 Sep 2014 19:05:36 +0000 (14:05 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 22 Sep 2014 19:09:59 +0000 (14:09 -0500)
We want to make sure it works nicely first.

mediagoblin/gmg_commands/dbupdate.py

index f5c20720aaede6c3895290403861e6dd5abecd1a..31827cd09638b74fcc0c8492fb9447e09c08aaa0 100644 (file)
@@ -16,6 +16,7 @@
 
 import logging
 
+import six
 from sqlalchemy.orm import sessionmaker
 
 from mediagoblin.db.open import setup_connection_and_db_from_config
@@ -125,7 +126,11 @@ def run_dbupdate(app_config, global_config):
     db = setup_connection_and_db_from_config(app_config, migrations=True)
     # Run the migrations
     run_all_migrations(db, app_config, global_config)
-    run_alembic_migrations(db, app_config, global_config)
+
+    # TODO: Make this happen regardless of python 2 or 3 once ensured
+    # to be "safe"!
+    if six.PY3:
+        run_alembic_migrations(db, app_config, global_config)
 
 
 def run_all_migrations(db, app_config, global_config):