"""add roles images modes models

Revision ID: c3aafcd58735
Revises: 97ef9b957a02
Create Date: 2026-03-30 19:43:35.616037

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'c3aafcd58735'
down_revision: Union[str, None] = '97ef9b957a02'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ai_model_configs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('model_id', sa.String(), nullable=False),
    sa.Column('task', sa.String(), nullable=False),
    sa.Column('api_key', sa.String(), nullable=True),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('is_default', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('model_id')
    )
    op.create_index(op.f('ix_ai_model_configs_id'), 'ai_model_configs', ['id'], unique=False)
    op.add_column('questions', sa.Column('image_path', sa.String(), nullable=True))
    op.add_column('quizzes', sa.Column('time_limit_minutes', sa.Integer(), nullable=True))
    op.add_column('quizzes', sa.Column('mode', sa.String(), nullable=True))
    op.add_column('users', sa.Column('role', sa.String(), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('users', 'role')
    op.drop_column('quizzes', 'mode')
    op.drop_column('quizzes', 'time_limit_minutes')
    op.drop_column('questions', 'image_path')
    op.drop_index(op.f('ix_ai_model_configs_id'), table_name='ai_model_configs')
    op.drop_table('ai_model_configs')
    # ### end Alembic commands ###
