Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-12 15:04:22 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:07 -0700
commitf1577a725772b42f72aaacea6de34febcc119f0c (patch)
tree7e1448f872349bfe04fc61b905c18427efb28e08
parent99a51bbde6816b7546170474584a2da499d3026b (diff)
STL media type initial migration.
* mediagoblin/media_types/stl/migrations/16134ed134ad_stl_media_type_initial_migration.py: New file.
-rw-r--r--mediagoblin/media_types/stl/migrations/16134ed134ad_stl_media_type_initial_migration.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/mediagoblin/media_types/stl/migrations/16134ed134ad_stl_media_type_initial_migration.py b/mediagoblin/media_types/stl/migrations/16134ed134ad_stl_media_type_initial_migration.py
new file mode 100644
index 00000000..38a8d7e7
--- /dev/null
+++ b/mediagoblin/media_types/stl/migrations/16134ed134ad_stl_media_type_initial_migration.py
@@ -0,0 +1,40 @@
+"""STL media type initial migration
+
+Revision ID: 16134ed134ad
+Revises: 52bf0ccbedc1
+Create Date: 2016-03-12 23:00:43.084284
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '16134ed134ad'
+down_revision = '52bf0ccbedc1'
+branch_labels = ('stl_media_type',)
+depends_on = None
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ if op.get_bind().engine.has_table("stl__mediadata"):
+ # Skip; this has already been instantiated
+ # (probably via sqlalchemy-migrate)
+ return
+
+ op.create_table(
+ 'stl__mediadata',
+ sa.Column('media_entry', sa.Integer(), nullable=False),
+ sa.Column('center_x', sa.Float(), nullable=True),
+ sa.Column('center_y', sa.Float(), nullable=True),
+ sa.Column('center_z', sa.Float(), nullable=True),
+ sa.Column('width', sa.Float(), nullable=True),
+ sa.Column('height', sa.Float(), nullable=True),
+ sa.Column('depth', sa.Float(), nullable=True),
+ sa.Column('file_type', sa.String(), nullable=True),
+ sa.ForeignKeyConstraint(['media_entry'], ['core__media_entries.id'], ),
+ sa.PrimaryKeyConstraint('media_entry'))
+
+
+def downgrade():
+ op.drop_table('stl__mediadata')