"""empty message

Revision ID: 191dd6d4d552
Revises: b90717c59669
Create Date: 2019-11-05 19:28:16.673297

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '191dd6d4d552'
down_revision = 'b90717c59669'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'categories',
        sa.Column('is_active',
                  sa.Boolean(),
                  server_default='1',
                  nullable=False),
        sa.Column('is_deleted',
                  sa.Boolean(),
                  server_default='0',
                  nullable=False),
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('name', sa.String(length=100), nullable=False),
        sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('name'))
    op.create_table(
        'products',
        sa.Column('is_active',
                  sa.Boolean(),
                  server_default='1',
                  nullable=False),
        sa.Column('is_deleted',
                  sa.Boolean(),
                  server_default='0',
                  nullable=False),
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('name', sa.String(length=100), nullable=False),
        sa.Column('category_id', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(['category_id'], ['categories.id'],
                                onupdate='CASCADE',
                                ondelete='RESTRICT'),
        sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('name'))
    # ### end Alembic commands ###


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