Image media type initial migration.
* mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py: New file.
This commit is contained in:
parent
385b5b44f5
commit
2d8b42aab3
@ -0,0 +1,36 @@
|
||||
"""Image media type initial migration
|
||||
|
||||
Revision ID: a98c1a320e88
|
||||
Revises: 52bf0ccbedc1
|
||||
Create Date: 2016-03-12 21:10:10.155623
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a98c1a320e88'
|
||||
down_revision = '52bf0ccbedc1'
|
||||
branch_labels = ('image_media_type',)
|
||||
depends_on = None
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
if op.get_bind().engine.has_table("image__mediadata"):
|
||||
# Skip; this has already been instantiated
|
||||
# (probably via sqlalchemy-migrate)
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'image__mediadata',
|
||||
sa.Column('media_entry', sa.Integer(), nullable=False),
|
||||
sa.Column('width', sa.Integer(), nullable=True),
|
||||
sa.Column('height', sa.Integer(), nullable=True),
|
||||
sa.Column('exif_all', sa.UnicodeText(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['media_entry'], ['core__media_entries.id'], ),
|
||||
sa.PrimaryKeyConstraint('media_entry'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
# @@: Is this safe?
|
||||
op.drop_table('image__mediadata')
|
Loading…
x
Reference in New Issue
Block a user