Make alembic use our db connection instead of their own
Diff
alembic.ini | 2 --
migrations/env.py | 9 +++++----
2 files changed, 3 insertions(+), 8 deletions(-)
@@ -29,8 +29,6 @@
sqlalchemy.url = postgresql://dave:dave@127.0.0.1/dave
[loggers]
keys = root,sqlalchemy,alembic
@@ -1,6 +1,6 @@
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from sqlalchemy import pool
from logging.config import fileConfig
import os
import sys
@@ -9,7 +9,7 @@
parent_dir = os.path.abspath(os.path.join(basepath, ".."))
sys.path.append(parent_dir)
from dave.config import config as dave_config
from dave.config import db, config as dave_config
@@ -58,10 +58,7 @@
and associate a connection with the context.
"""
connectable = engine_from_config(
config.get_section(config.config_ini_section),
prefix='sqlalchemy.',
poolclass=pool.NullPool)
connectable = db
with connectable.connect() as connection:
context.configure(