Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-12 14:52:09 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:07 -0700
commit7d372097556721cbb181f3dd67e1b6456e331d74 (patch)
treeb8254d071ae4a91fbe5742d736af2952ca859dbd
parent050bf6f43803477e0181de1e4d9346a4d415a3b5 (diff)
Video media type initial migration.
* mediagoblin/media_types/video/migrations/38feb829c545_video_media_type_initial_migration.py: New file.
-rw-r--r--mediagoblin/media_types/video/migrations/38feb829c545_video_media_type_initial_migration.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/mediagoblin/media_types/video/migrations/38feb829c545_video_media_type_initial_migration.py b/mediagoblin/media_types/video/migrations/38feb829c545_video_media_type_initial_migration.py
new file mode 100644
index 00000000..89d54eb9
--- /dev/null
+++ b/mediagoblin/media_types/video/migrations/38feb829c545_video_media_type_initial_migration.py
@@ -0,0 +1,36 @@
+"""Video media type initial migration
+
+Revision ID: 38feb829c545
+Revises: 52bf0ccbedc1
+Create Date: 2016-03-12 22:44:16.291834
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '38feb829c545'
+down_revision = '52bf0ccbedc1'
+branch_labels = ('video_media_type',)
+depends_on = None
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ if op.get_bind().engine.has_table("video__mediadata"):
+ # Skip; this has already been instantiated
+ # (probably via sqlalchemy-migrate)
+ return
+
+ op.create_table(
+ 'video__mediadata',
+ sa.Column('media_entry', sa.Integer(), nullable=False),
+ sa.Column('width', sa.SmallInteger(), nullable=True),
+ sa.Column('height', sa.SmallInteger(), nullable=True),
+ sa.Column('orig_metadata', sa.UnicodeText(), nullable=True),
+ sa.ForeignKeyConstraint(['media_entry'], ['core__media_entries.id'], ),
+ sa.PrimaryKeyConstraint('media_entry'))
+
+
+def downgrade():
+ op.drop_table('video__mediadata')