"""Add uniqueness constraint for Tasks

Revision ID: 45c13d4a9140
Revises: 13353ad5ffa7
Create Date: 2021-03-22 10:01:36.298063+00:00

"""
from alembic import op

# revision identifiers, used by Alembic.
revision = "45c13d4a9140"
down_revision = "13353ad5ffa7"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(
        "uq_Task_name_parent_id", "Tasks", ["name", "parent_id"], schema="pepys"
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("uq_Task_name_parent_id", "Tasks", schema="pepys", type_="unique")
    # ### end Alembic commands ###
