Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-12 15:46:02 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:08 -0700
commitc527242841e7c7408d4307cac0ef049a6db80930 (patch)
treea6ea6fd7d268a8a8e14d85d2cb271a51951b21dd
parentddbe3fef8ce47eef057e37d4c6d878abc055121a (diff)
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.
-rw-r--r--mediagoblin/plugins/archivalook/migrations/b10b5f822789_archivalook_plugin_initial_migration.py5
1 files changed, 5 insertions, 0 deletions
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),