"""constraint on product_relations

Revision ID: ce157c2fa22e
Revises: 0f7fd06aa729
Create Date: 2020-05-26 18:48:17.865643

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'ce157c2fa22e'
down_revision = '0f7fd06aa729'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('product_relations', schema=None) as batch_op:
        batch_op.create_unique_constraint('_type_id_self_product_id_other_product_id', ['type_id', 'self_product_id', 'other_product_id'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('product_relations', schema=None) as batch_op:
        batch_op.drop_constraint('_type_id_self_product_id_other_product_id', type_='unique')

    # ### end Alembic commands ###
