Merge "Also prefix the alembic_version table"

This commit is contained in:
Zuul 2018-04-11 20:15:40 +00:00 committed by Gerrit Code Review
commit 715b4c2fcd
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The alembic version table is fixed to being prefixed too. This is necessary
when using :attr:`<sql connection>.table_prefix`. However if you are
already using ``table_prefix`` you will need to rename the table
``alembic_version`` to ``<prefix>alembic_version`` before starting Zuul.
Otherwise zuul will try to create the tables again and fail. If you're not
using ``table_prefix`` you can safely ignore this.

View File

@ -65,7 +65,8 @@ def run_migrations_online():
with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=target_metadata
target_metadata=target_metadata,
version_table=table_prefix + 'alembic_version'
)
with context.begin_transaction():