"""Added tabs explanation instructions

Revision ID: 553907642bcf
Revises: f97e57bc1470
Create Date: 2021-10-13 12:26:44.155932

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '553907642bcf'
down_revision = 'f97e57bc1470'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tabs',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('category_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('explanation',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('description', sa.Text(), nullable=False),
    sa.Column('category_id', sa.String(), nullable=True),
    sa.Column('tab_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ),
    sa.ForeignKeyConstraint(['tab_id'], ['tabs.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('instructions',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('link', sa.String(), nullable=False),
    sa.Column('category_id', sa.String(), nullable=True),
    sa.Column('tab_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ),
    sa.ForeignKeyConstraint(['tab_id'], ['tabs.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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