"""add shop_id to cart

Revision ID: 201924e6306f
Revises: aad3d454a6f4
Create Date: 2022-07-10 13:21:40.740356

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "201924e6306f"
down_revision = "aad3d454a6f4"
branch_labels = None
depends_on = None

from make_post_sell.models.meta import UUIDType


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("mps_cart", sa.Column("shop_id", UUIDType, nullable=True))
    op.add_column("mps_cart", sa.Column("active", sa.Boolean(), nullable=True))
    op.create_index(op.f("ix_mps_cart_id"), "mps_cart", ["id"], unique=False)
    # op.create_foreign_key(None, 'mps_cart', 'mps_user', ['user_id'], ['id'])
    # op.create_foreign_key(None, 'mps_cart', 'mps_shop', ['shop_id'], ['id'])
    # op.drop_column('mps_user_shop', 'default')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_mps_cart_id"), table_name="mps_cart")
    op.drop_column("mps_cart", "active")
    op.drop_column("mps_cart", "shop_id")
    # ### end Alembic commands ###
