Manage ASL magazines and their articles.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
asl-articles/alembic/versions/e77d4e8d37f3_added_the_scen...

45 lines
1.6 KiB

"""Added the 'scenario' tables.
Revision ID: e77d4e8d37f3
Revises: 23e928dda837
Create Date: 2019-12-20 09:46:35.304849
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e77d4e8d37f3'
down_revision = '23e928dda837'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('scenario',
sa.Column('scenario_id', sa.Integer(), nullable=False),
sa.Column('scenario_roar_id', sa.String(length=50), nullable=True),
sa.Column('scenario_display_id', sa.String(length=50), nullable=True),
sa.Column('scenario_name', sa.String(length=200), nullable=False),
sa.PrimaryKeyConstraint('scenario_id'),
sa.UniqueConstraint('scenario_roar_id', 'scenario_display_id', 'scenario_name', name='unq_id_name')
)
op.create_table('article_scenario',
sa.Column('article_scenario_id', sa.Integer(), nullable=False),
sa.Column('seq_no', sa.Integer(), nullable=False),
sa.Column('article_id', sa.Integer(), nullable=False),
sa.Column('scenario_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['article_id'], ['article.article_id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['scenario_id'], ['scenario.scenario_id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('article_scenario_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('article_scenario')
op.drop_table('scenario')
# ### end Alembic commands ###