"""empty message

Revision ID: a127583fb43d
Revises: a29cd2b6c492
Create Date: 2021-04-19 18:38:06.560305

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a127583fb43d'
down_revision = 'a29cd2b6c492'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('orders', sa.Column('address', sa.String(length=255), nullable=True))
    op.add_column('orders', sa.Column('item', sa.Integer(), nullable=True))
    op.add_column('orders', sa.Column('quantity', sa.Integer(), nullable=True))
    op.drop_constraint('orders_o_pid_fkey', 'orders', type_='foreignkey')
    op.create_foreign_key(None, 'orders', 'products', ['item'], ['pid'])
    op.drop_column('orders', 'o_pid')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('orders', sa.Column('o_pid', sa.INTEGER(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'orders', type_='foreignkey')
    op.create_foreign_key('orders_o_pid_fkey', 'orders', 'products', ['o_pid'], ['pid'])
    op.drop_column('orders', 'quantity')
    op.drop_column('orders', 'item')
    op.drop_column('orders', 'address')
    # ### end Alembic commands ###
