<gh_stars>0
"""add unique constraint on roles table (one project - one user role)

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-04-15 14:53:39.086815

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(op.f('uq__roles__user_id_project_id'), 'roles', ['user_id', 'project_id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('uq__roles__user_id_project_id'), 'roles', type_='unique')
    # ### end Alembic commands ###
