"""Add advanced quiz fields like is_published and is_required

Revision ID: a8f8c33e3532
Revises: 0345434dad27
Create Date: 2026-03-04 22:28:31.333020

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a8f8c33e3532'
down_revision = '0345434dad27'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('questions', schema=None) as batch_op:
        batch_op.add_column(sa.Column('is_required', sa.Boolean(), nullable=False))
        batch_op.add_column(sa.Column('points', sa.Integer(), nullable=False))
        batch_op.add_column(sa.Column('explanation', sa.Text(), nullable=True))

    with op.batch_alter_table('quizzes', schema=None) as batch_op:
        batch_op.add_column(sa.Column('is_published', sa.Boolean(), nullable=False))
        batch_op.add_column(sa.Column('allow_responses', sa.Boolean(), nullable=False))
        batch_op.add_column(sa.Column('shuffle_questions', sa.Boolean(), nullable=False))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('quizzes', schema=None) as batch_op:
        batch_op.drop_column('shuffle_questions')
        batch_op.drop_column('allow_responses')
        batch_op.drop_column('is_published')

    with op.batch_alter_table('questions', schema=None) as batch_op:
        batch_op.drop_column('explanation')
        batch_op.drop_column('points')
        batch_op.drop_column('is_required')

    # ### end Alembic commands ###
