aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/migrations/versions/afd3d1da5e29_subtitle_plugin_initial_migration.py
blob: 7177480a4f4b0ca50b39649fa43fff08712f9568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Subtitle plugin initial migration

Revision ID: afd3d1da5e29
Revises: 228916769bd2
Create Date: 2016-06-03 11:48:03.369079

"""

# revision identifiers, used by Alembic.
revision = 'afd3d1da5e29'
down_revision = '228916769bd2'
branch_labels = ('subtitles_plugin',)
depends_on = None

from alembic import op
import sqlalchemy as sa
from mediagoblin.db.extratypes import PathTupleWithSlashes

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('core__subtitle_files',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('media_entry', sa.Integer(), nullable=False),
    sa.Column('name', sa.Unicode(), nullable=False),
    sa.Column('filepath', PathTupleWithSlashes(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['media_entry'], ['core__media_entries.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('core__subtitle_files')
    ### end Alembic commands ###