"""role_permission role permission unique constratint

Revision ID: c0ee28914ed5
Revises: 2114b71ae0e7
Create Date: 2023-04-02 14:32:28.439167

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "c0ee28914ed5"
down_revision = "2114b71ae0e7"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        "role_permissions_permission_key", "role_permissions", type_="unique"
    )
    op.create_unique_constraint(
        "role_permission_uq", "role_permissions", ["role", "permission"]
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("role_permission_uq", "role_permissions", type_="unique")
    op.create_unique_constraint(
        "role_permissions_permission_key", "role_permissions", ["permission"]
    )
    # ### end Alembic commands ###
