"""Make sure each student can only respond once for a given question/session

Revision ID: bcdfd6bd3d3a
Revises: 40f6977ec0bf
Create Date: 2020-02-17 16:44:28.541205

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bcdfd6bd3d3a'
down_revision = '40f6977ec0bf'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint('_session_student_response_uc', 'form_response', ['session_id', 'class_section_student_id', 'form_question_id'])
    # ### end Alembic commands ###


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