Only run archivalook migration if the tables aren't there.

Standard for anything existing before the Alembic move-over, but I
forgot this one.

* mediagoblin/plugins/archivalook/migrations/b10b5f822789_archivalook_plugin_initial_migration.py
  (upgrade): Add has_table check, skip if such a table already exists.
This commit is contained in:
Christopher Allan Webber 2016-03-12 15:46:02 -08:00
parent ddbe3fef8c
commit c527242841

View File

@ -17,6 +17,11 @@ import sqlalchemy as sa
def upgrade():
if op.get_bind().engine.has_table('archivalook__featured_media'):
# Skip; this has already been instantiated
# (probably via sqlalchemy-migrate)
return
op.create_table(
'archivalook__featured_media',
sa.Column('id', sa.Integer(), nullable=False),