1 """ArchivaLook plugin initial migration
3 Revision ID: b10b5f822789
5 Create Date: 2016-03-12 23:37:51.551856
9 # revision identifiers, used by Alembic.
10 revision
= 'b10b5f822789'
11 down_revision
= '52bf0ccbedc1'
12 branch_labels
= ('archivalook_plugin',)
15 from alembic
import op
16 import sqlalchemy
as sa
20 if op
.get_bind().engine
.has_table('archivalook__featured_media'):
21 # Skip; this has already been instantiated
22 # (probably via sqlalchemy-migrate)
26 'archivalook__featured_media',
27 sa
.Column('id', sa
.Integer(), nullable
=False),
28 sa
.Column('media_entry_id', sa
.Integer(), nullable
=False),
29 sa
.Column('display_type', sa
.Unicode(), nullable
=False),
30 sa
.Column('order', sa
.Integer(), nullable
=False),
31 sa
.ForeignKeyConstraint(['media_entry_id'],
32 ['core__media_entries.id']),
33 sa
.PrimaryKeyConstraint('id'))
37 op
.drop_table('archivalook__featured_media')