"""empty message

Revision ID: f2e64f36637f
Revises: c5d3a633af1b
Create Date: 2020-09-27 19:04:19.444701

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f2e64f36637f'
down_revision = 'c5d3a633af1b'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('product', sa.Column('category_name', sa.String(length=100), nullable=True))
    op.execute("UPDATE product SET category_name = 'crop'")
    op.alter_column('product', 'category_name', nullable=False)
    op.alter_column('product', 'sale_type',
               existing_type=sa.VARCHAR(length=20),
               nullable=True)
    op.alter_column('product', 'sale_type', nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('product', 'sale_type',
               existing_type=sa.VARCHAR(length=20),
               nullable=False)
    op.drop_column('product', 'category_name')
    # ### end Alembic commands ###
