"""make login unique on github_users

Revision ID: 8585129ca524
Revises: bad578ddbf3a
Create Date: 2020-12-26 14:31:39.829514

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8585129ca524'
down_revision = 'bad578ddbf3a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('github_users', schema=None) as batch_op:
        batch_op.create_unique_constraint(batch_op.f('uq_github_users_login'), ['login'])

    # ### end Alembic commands ###


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

    # ### end Alembic commands ###
