From c527242841e7c7408d4307cac0ef049a6db80930 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 12 Mar 2016 15:46:02 -0800 Subject: [PATCH] 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. --- .../b10b5f822789_archivalook_plugin_initial_migration.py | 5 +++++ 1 file changed, 5 insertions(+) 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), -- 2.25.1