"""added unique constraints

Revision ID: cbd502abf5ab
Revises: c55ccf39e932
Create Date: 2019-09-07 02:56:32.270861

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'cbd502abf5ab'
down_revision = 'c55ccf39e932'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(op.f('uq_concepts_ui'), 'concepts', ['ui', 'name'], schema='mesh')
    op.create_unique_constraint(op.f('uq_descriptors_ui'), 'descriptors', ['ui', 'name'], schema='mesh')
    op.create_unique_constraint(op.f('uq_qualifiers_ui'), 'qualifiers', ['ui', 'name'], schema='mesh')
    op.create_unique_constraint(op.f('uq_supplementals_ui'), 'supplementals', ['ui', 'name'], schema='mesh')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('uq_supplementals_ui'), 'supplementals', schema='mesh', type_='unique')
    op.drop_constraint(op.f('uq_qualifiers_ui'), 'qualifiers', schema='mesh', type_='unique')
    op.drop_constraint(op.f('uq_descriptors_ui'), 'descriptors', schema='mesh', type_='unique')
    op.drop_constraint(op.f('uq_concepts_ui'), 'concepts', schema='mesh', type_='unique')
    # ### end Alembic commands ###
