Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-12 14:51:20 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:07 -0700
commit050bf6f43803477e0181de1e4d9346a4d415a3b5 (patch)
tree24bd25c745aa0f30a7218c93e205dcd371076c33
parent2d8b42aab39d78ff93d228be9a94e7f5596ad482 (diff)
Audio media type initial migration.
* mediagoblin/media_types/audio/migrations/e9212d3a12d3_adding_audio_media_type_initial_.py: New file.
-rw-r--r--mediagoblin/media_types/audio/migrations/e9212d3a12d3_adding_audio_media_type_initial_.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/mediagoblin/media_types/audio/migrations/e9212d3a12d3_adding_audio_media_type_initial_.py b/mediagoblin/media_types/audio/migrations/e9212d3a12d3_adding_audio_media_type_initial_.py
new file mode 100644
index 00000000..20d900a8
--- /dev/null
+++ b/mediagoblin/media_types/audio/migrations/e9212d3a12d3_adding_audio_media_type_initial_.py
@@ -0,0 +1,32 @@
+"""Audio media type initial migration
+
+Revision ID: e9212d3a12d3
+Revises: 52bf0ccbedc1
+Create Date: 2016-03-12 22:37:35.086080
+"""
+
+# revision identifiers, used by Alembic.
+revision = 'e9212d3a12d3'
+down_revision = '52bf0ccbedc1'
+branch_labels = ('audio_media_type',)
+depends_on = None
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ if op.get_bind().engine.has_table("audio__mediadata"):
+ # Skip; this has already been instantiated
+ # (probably via sqlalchemy-migrate)
+ return
+
+ op.create_table(
+ 'audio__mediadata',
+ sa.Column('media_entry', sa.Integer(), nullable=False),
+ sa.ForeignKeyConstraint(['media_entry'], ['core__media_entries.id'], ),
+ sa.PrimaryKeyConstraint('media_entry'))
+
+
+def downgrade():
+ op.drop_table('audio__mediadata')