From 2ddebb97bfbb281bcb48e699d5b0c493cd9932c0 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Mon, 18 Jan 2016 09:39:34 +0000 Subject: Fix #5391 - Alembic migrations would only work for SQLite The database connection was being set in a alembic.ini config file, if the user had specified postgres the "sqlite" connection URL in alembic.ini would override that. We probably should look into this more so i've opened #5395. --- mediagoblin/db/migration_tools.py | 1 + 1 file changed, 1 insertion(+) (limited to 'mediagoblin/db/migration_tools.py') diff --git a/mediagoblin/db/migration_tools.py b/mediagoblin/db/migration_tools.py index 756c1093..e34685f5 100644 --- a/mediagoblin/db/migration_tools.py +++ b/mediagoblin/db/migration_tools.py @@ -42,6 +42,7 @@ class AlembicMigrationManager(object): os.path.dirname(__file__)))) alembic_cfg_path = os.path.join(root_dir, 'alembic.ini') self.alembic_cfg = Config(alembic_cfg_path) + self.alembic_cfg.set_main_option("sqlalchemy.url", str(session.get_bind().url)) self.session = session def get_current_revision(self): -- cgit v1.2.3