From: Christopher Allan Webber Date: Sat, 12 Mar 2016 23:46:02 +0000 (-0800) Subject: Only run archivalook migration if the tables aren't there. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c527242841e7c7408d4307cac0ef049a6db80930;p=mediagoblin.git 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. --- diff --git a/mediagoblin/plugins/archivalook/migrations/b10b5f822789_archivalook_plugin_initial_migration.py b/mediagoblin/plugins/archivalook/migrations/b10b5f822789_archivalook_plugin_initial_migration.py index 0dfa2ac1..1bedcf3c 100644 --- a/mediagoblin/plugins/archivalook/migrations/b10b5f822789_archivalook_plugin_initial_migration.py +++ b/mediagoblin/plugins/archivalook/migrations/b10b5f822789_archivalook_plugin_initial_migration.py @@ -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),