Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-12 14:36:23 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:07 -0700
commit2d8b42aab39d78ff93d228be9a94e7f5596ad482 (patch)
tree1307e235f4fd73bf7f0dffd1d8774ba64f40f6b4
parent385b5b44f5fb8b68f75f991e3259b395fe628d20 (diff)
Image media type initial migration.
* mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py: New file.
-rw-r--r--mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py b/mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py
new file mode 100644
index 00000000..1ba73a28
--- /dev/null
+++ b/mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py
@@ -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')