"""add product table

Revision ID: 3f7d6393ba3a
Revises: 71964e08a055
Create Date: 2021-04-16 10:52:35.092016

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3f7d6393ba3a'
down_revision = '71964e08a055'
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('product_name', sa.String(length=100), nullable=True),
    sa.Column('std_price', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('proposals', sa.Column('product_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'proposals', 'products', ['product_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'proposals', type_='foreignkey')
    op.drop_column('proposals', 'product_id')
    op.drop_table('products')
    # ### end Alembic commands ###
