"""empty message

Revision ID: 09302a76f72d
Revises: 
Create Date: 2020-01-17 16:50:47.162009

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '09302a76f72d'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('products',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=500), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('image', sa.String(), nullable=True),
    sa.Column('quantity', sa.Integer(), nullable=True),
    sa.Column('price', sa.Float(), nullable=True),
    sa.Column('category_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column('categories', 'name',
               existing_type=sa.CHAR(length=50),
               nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('categories', 'name',
               existing_type=sa.CHAR(length=50),
               nullable=False)
    op.drop_table('products')
    # ### end Alembic commands ###
