"""Add unique constraint

Revision ID: 17cca4a9d477
Revises: 26ecde3021bd
Create Date: 2017-06-11 22:33:28.607601

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '17cca4a9d477'
down_revision = '26ecde3021bd'
branch_labels = None
depends_on = None


def upgrade():
    op.create_unique_constraint(None, 'votes', ['vote_key', 'election_id'])
    # ### end Alembic commands ###


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