Add migration script for corpora table.

This commit is contained in:
Patrick Jentsch 2019-08-06 12:06:27 +02:00
parent 525d53a906
commit ebba2913f8

View File

@ -0,0 +1,35 @@
"""Add corpora table
Revision ID: 60d474dea68f
Revises: 717796966c8c
Create Date: 2019-08-06 12:03:30.639380
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '60d474dea68f'
down_revision = '717796966c8c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('corpora',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('description', sa.String(length=64), nullable=True),
sa.Column('title', sa.String(length=32), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('corpora')
# ### end Alembic commands ###