<gh_stars>0
"""init db

Revision ID: 706236b4fa75
Revises: 
Create Date: 2021-09-19 23:49:52.331525

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('affect_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_affect_tag_id'), 'affect_tag', ['id'], unique=False)
    op.create_index(op.f('ix_affect_tag_name'), 'affect_tag', ['name'], unique=False)
    op.create_table('complication_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_complication_tag_id'), 'complication_tag', ['id'], unique=False)
    op.create_index(op.f('ix_complication_tag_name'), 'complication_tag', ['name'], unique=False)
    op.create_table('drug_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_drug_tag_id'), 'drug_tag', ['id'], unique=False)
    op.create_index(op.f('ix_drug_tag_name'), 'drug_tag', ['name'], unique=False)
    op.create_table('emotions_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_emotions_tag_id'), 'emotions_tag', ['id'], unique=False)
    op.create_index(op.f('ix_emotions_tag_name'), 'emotions_tag', ['name'], unique=False)
    op.create_table('feel_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_feel_tag_id'), 'feel_tag', ['id'], unique=False)
    op.create_index(op.f('ix_feel_tag_name'), 'feel_tag', ['name'], unique=False)
    op.create_table('foreboding_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_foreboding_tag_id'), 'foreboding_tag', ['id'], unique=False)
    op.create_index(op.f('ix_foreboding_tag_name'), 'foreboding_tag', ['name'], unique=False)
    op.create_table('relief_pain_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_relief_pain_tag_id'), 'relief_pain_tag', ['id'], unique=False)
    op.create_index(op.f('ix_relief_pain_tag_name'), 'relief_pain_tag', ['name'], unique=False)
    op.create_table('treatment_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_treatment_tag_id'), 'treatment_tag', ['id'], unique=False)
    op.create_index(op.f('ix_treatment_tag_name'), 'treatment_tag', ['name'], unique=False)
    op.create_table('triggers_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_triggers_tag_id'), 'triggers_tag', ['id'], unique=False)
    op.create_index(op.f('ix_triggers_tag_name'), 'triggers_tag', ['name'], unique=False)
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('full_name', sa.String(), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('phone_number', sa.String(), nullable=True),
    sa.Column('hashed_password', sa.String(), nullable=False),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('is_superuser', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_full_name'), 'user', ['full_name'], unique=False)
    op.create_index(op.f('ix_user_id'), 'user', ['id'], unique=False)
    op.create_index(op.f('ix_user_phone_number'), 'user', ['phone_number'], unique=True)
    op.create_table('item',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('pain_minute', sa.Integer(), nullable=True, comment='疼痛时常，以分钟为单位，原头痛开始结束时间'),
    sa.Column('pain_level', sa.Integer(), nullable=True, comment='疼痛等级/10级'),
    sa.Column('sleep_quality', sa.Integer(), nullable=True, comment='睡眠质量/10级'),
    sa.Column('painful_number', sa.Integer(), nullable=True, comment='头痛次数/天'),
    sa.Column('painful_area', sa.String(), nullable=True, comment='头痛部位'),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.Column('owner_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_item_description'), 'item', ['description'], unique=False)
    op.create_index(op.f('ix_item_id'), 'item', ['id'], unique=False)
    op.create_index(op.f('ix_item_title'), 'item', ['title'], unique=False)
    op.create_table('item_affect_tag_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('affect_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['affect_tag_id'], ['affect_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'affect_tag_id')
    )
    op.create_table('item_complication_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('complication_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['complication_tag_id'], ['complication_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'complication_tag_id')
    )
    op.create_table('item_drug_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('drug_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['drug_tag_id'], ['drug_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'drug_tag_id')
    )
    op.create_table('item_emotions_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('emotions_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['emotions_tag_id'], ['emotions_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'emotions_tag_id')
    )
    op.create_table('item_feel_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('feel_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['feel_tag_id'], ['feel_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'feel_tag_id')
    )
    op.create_table('item_foreboding_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('foreboding_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['foreboding_tag_id'], ['foreboding_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'foreboding_tag_id')
    )
    op.create_table('item_relief_pain_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('reliefpain_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.ForeignKeyConstraint(['reliefpain_tag_id'], ['relief_pain_tag.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'reliefpain_tag_id')
    )
    op.create_table('item_treatment_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('treatment_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.ForeignKeyConstraint(['treatment_tag_id'], ['treatment_tag.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'treatment_tag_id')
    )
    op.create_table('item_triggers_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('triggers_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.ForeignKeyConstraint(['triggers_tag_id'], ['triggers_tag.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'triggers_tag_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('item_triggers_tag')
    op.drop_table('item_treatment_tag')
    op.drop_table('item_relief_pain_tag')
    op.drop_table('item_foreboding_tag')
    op.drop_table('item_feel_tag')
    op.drop_table('item_emotions_tag')
    op.drop_table('item_drug_tag')
    op.drop_table('item_complication_tag')
    op.drop_table('item_affect_tag_tag')
    op.drop_index(op.f('ix_item_title'), table_name='item')
    op.drop_index(op.f('ix_item_id'), table_name='item')
    op.drop_index(op.f('ix_item_description'), table_name='item')
    op.drop_table('item')
    op.drop_index(op.f('ix_user_phone_number'), table_name='user')
    op.drop_index(op.f('ix_user_id'), table_name='user')
    op.drop_index(op.f('ix_user_full_name'), table_name='user')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_table('user')
    op.drop_index(op.f('ix_triggers_tag_name'), table_name='triggers_tag')
    op.drop_index(op.f('ix_triggers_tag_id'), table_name='triggers_tag')
    op.drop_table('triggers_tag')
    op.drop_index(op.f('ix_treatment_tag_name'), table_name='treatment_tag')
    op.drop_index(op.f('ix_treatment_tag_id'), table_name='treatment_tag')
    op.drop_table('treatment_tag')
    op.drop_index(op.f('ix_relief_pain_tag_name'), table_name='relief_pain_tag')
    op.drop_index(op.f('ix_relief_pain_tag_id'), table_name='relief_pain_tag')
    op.drop_table('relief_pain_tag')
    op.drop_index(op.f('ix_foreboding_tag_name'), table_name='foreboding_tag')
    op.drop_index(op.f('ix_foreboding_tag_id'), table_name='foreboding_tag')
    op.drop_table('foreboding_tag')
    op.drop_index(op.f('ix_feel_tag_name'), table_name='feel_tag')
    op.drop_index(op.f('ix_feel_tag_id'), table_name='feel_tag')
    op.drop_table('feel_tag')
    op.drop_index(op.f('ix_emotions_tag_name'), table_name='emotions_tag')
    op.drop_index(op.f('ix_emotions_tag_id'), table_name='emotions_tag')
    op.drop_table('emotions_tag')
    op.drop_index(op.f('ix_drug_tag_name'), table_name='drug_tag')
    op.drop_index(op.f('ix_drug_tag_id'), table_name='drug_tag')
    op.drop_table('drug_tag')
    op.drop_index(op.f('ix_complication_tag_name'), table_name='complication_tag')
    op.drop_index(op.f('ix_complication_tag_id'), table_name='complication_tag')
    op.drop_table('complication_tag')
    op.drop_index(op.f('ix_affect_tag_name'), table_name='affect_tag')
    op.drop_index(op.f('ix_affect_tag_id'), table_name='affect_tag')
    op.drop_table('affect_tag')
    # ### end Alembic commands ###

"""init db

Revision ID: 706236b4fa75
Revises: 
Create Date: 2021-09-19 23:49:52.331525

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('affect_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_affect_tag_id'), 'affect_tag', ['id'], unique=False)
    op.create_index(op.f('ix_affect_tag_name'), 'affect_tag', ['name'], unique=False)
    op.create_table('complication_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_complication_tag_id'), 'complication_tag', ['id'], unique=False)
    op.create_index(op.f('ix_complication_tag_name'), 'complication_tag', ['name'], unique=False)
    op.create_table('drug_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_drug_tag_id'), 'drug_tag', ['id'], unique=False)
    op.create_index(op.f('ix_drug_tag_name'), 'drug_tag', ['name'], unique=False)
    op.create_table('emotions_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_emotions_tag_id'), 'emotions_tag', ['id'], unique=False)
    op.create_index(op.f('ix_emotions_tag_name'), 'emotions_tag', ['name'], unique=False)
    op.create_table('feel_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_feel_tag_id'), 'feel_tag', ['id'], unique=False)
    op.create_index(op.f('ix_feel_tag_name'), 'feel_tag', ['name'], unique=False)
    op.create_table('foreboding_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_foreboding_tag_id'), 'foreboding_tag', ['id'], unique=False)
    op.create_index(op.f('ix_foreboding_tag_name'), 'foreboding_tag', ['name'], unique=False)
    op.create_table('relief_pain_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_relief_pain_tag_id'), 'relief_pain_tag', ['id'], unique=False)
    op.create_index(op.f('ix_relief_pain_tag_name'), 'relief_pain_tag', ['name'], unique=False)
    op.create_table('treatment_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_treatment_tag_id'), 'treatment_tag', ['id'], unique=False)
    op.create_index(op.f('ix_treatment_tag_name'), 'treatment_tag', ['name'], unique=False)
    op.create_table('triggers_tag',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('level', sa.Integer(), nullable=True, comment='标签顺序等级'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_triggers_tag_id'), 'triggers_tag', ['id'], unique=False)
    op.create_index(op.f('ix_triggers_tag_name'), 'triggers_tag', ['name'], unique=False)
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('full_name', sa.String(), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('phone_number', sa.String(), nullable=True),
    sa.Column('hashed_password', sa.String(), nullable=False),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('is_superuser', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_full_name'), 'user', ['full_name'], unique=False)
    op.create_index(op.f('ix_user_id'), 'user', ['id'], unique=False)
    op.create_index(op.f('ix_user_phone_number'), 'user', ['phone_number'], unique=True)
    op.create_table('item',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('pain_minute', sa.Integer(), nullable=True, comment='疼痛时常，以分钟为单位，原头痛开始结束时间'),
    sa.Column('pain_level', sa.Integer(), nullable=True, comment='疼痛等级/10级'),
    sa.Column('sleep_quality', sa.Integer(), nullable=True, comment='睡眠质量/10级'),
    sa.Column('painful_number', sa.Integer(), nullable=True, comment='头痛次数/天'),
    sa.Column('painful_area', sa.String(), nullable=True, comment='头痛部位'),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.Column('owner_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_item_description'), 'item', ['description'], unique=False)
    op.create_index(op.f('ix_item_id'), 'item', ['id'], unique=False)
    op.create_index(op.f('ix_item_title'), 'item', ['title'], unique=False)
    op.create_table('item_affect_tag_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('affect_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['affect_tag_id'], ['affect_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'affect_tag_id')
    )
    op.create_table('item_complication_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('complication_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['complication_tag_id'], ['complication_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'complication_tag_id')
    )
    op.create_table('item_drug_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('drug_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['drug_tag_id'], ['drug_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'drug_tag_id')
    )
    op.create_table('item_emotions_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('emotions_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['emotions_tag_id'], ['emotions_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'emotions_tag_id')
    )
    op.create_table('item_feel_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('feel_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['feel_tag_id'], ['feel_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'feel_tag_id')
    )
    op.create_table('item_foreboding_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('foreboding_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['foreboding_tag_id'], ['foreboding_tag.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'foreboding_tag_id')
    )
    op.create_table('item_relief_pain_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('reliefpain_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.ForeignKeyConstraint(['reliefpain_tag_id'], ['relief_pain_tag.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'reliefpain_tag_id')
    )
    op.create_table('item_treatment_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('treatment_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.ForeignKeyConstraint(['treatment_tag_id'], ['treatment_tag.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'treatment_tag_id')
    )
    op.create_table('item_triggers_tag',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('triggers_tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['item_id'], ['item.id'], ),
    sa.ForeignKeyConstraint(['triggers_tag_id'], ['triggers_tag.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'triggers_tag_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('item_triggers_tag')
    op.drop_table('item_treatment_tag')
    op.drop_table('item_relief_pain_tag')
    op.drop_table('item_foreboding_tag')
    op.drop_table('item_feel_tag')
    op.drop_table('item_emotions_tag')
    op.drop_table('item_drug_tag')
    op.drop_table('item_complication_tag')
    op.drop_table('item_affect_tag_tag')
    op.drop_index(op.f('ix_item_title'), table_name='item')
    op.drop_index(op.f('ix_item_id'), table_name='item')
    op.drop_index(op.f('ix_item_description'), table_name='item')
    op.drop_table('item')
    op.drop_index(op.f('ix_user_phone_number'), table_name='user')
    op.drop_index(op.f('ix_user_id'), table_name='user')
    op.drop_index(op.f('ix_user_full_name'), table_name='user')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_table('user')
    op.drop_index(op.f('ix_triggers_tag_name'), table_name='triggers_tag')
    op.drop_index(op.f('ix_triggers_tag_id'), table_name='triggers_tag')
    op.drop_table('triggers_tag')
    op.drop_index(op.f('ix_treatment_tag_name'), table_name='treatment_tag')
    op.drop_index(op.f('ix_treatment_tag_id'), table_name='treatment_tag')
    op.drop_table('treatment_tag')
    op.drop_index(op.f('ix_relief_pain_tag_name'), table_name='relief_pain_tag')
    op.drop_index(op.f('ix_relief_pain_tag_id'), table_name='relief_pain_tag')
    op.drop_table('relief_pain_tag')
    op.drop_index(op.f('ix_foreboding_tag_name'), table_name='foreboding_tag')
    op.drop_index(op.f('ix_foreboding_tag_id'), table_name='foreboding_tag')
    op.drop_table('foreboding_tag')
    op.drop_index(op.f('ix_feel_tag_name'), table_name='feel_tag')
    op.drop_index(op.f('ix_feel_tag_id'), table_name='feel_tag')
    op.drop_table('feel_tag')
    op.drop_index(op.f('ix_emotions_tag_name'), table_name='emotions_tag')
    op.drop_index(op.f('ix_emotions_tag_id'), table_name='emotions_tag')
    op.drop_table('emotions_tag')
    op.drop_index(op.f('ix_drug_tag_name'), table_name='drug_tag')
    op.drop_index(op.f('ix_drug_tag_id'), table_name='drug_tag')
    op.drop_table('drug_tag')
    op.drop_index(op.f('ix_complication_tag_name'), table_name='complication_tag')
    op.drop_index(op.f('ix_complication_tag_id'), table_name='complication_tag')
    op.drop_table('complication_tag')
    op.drop_index(op.f('ix_affect_tag_name'), table_name='affect_tag')
    op.drop_index(op.f('ix_affect_tag_id'), table_name='affect_tag')
    op.drop_table('affect_tag')
    # ### end Alembic commands ###
init db  Revision ID: 706236b4fa75 Revises:  Create Date: 2021-09-19 23:49:52.331525 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###