"""Add order column to topics table

Revision ID: f0f58ab55290
Revises: 
Create Date: 2025-03-05 13:52:12.838448

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

# revision identifiers, used by Alembic.
revision = 'f0f58ab55290'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('comprehension_questions', 'question_type')
    op.drop_column('comprehension_questions', 'correct_answer')
    op.drop_column('comprehension_questions', 'options')
    op.add_column('topics', sa.Column('order', sa.Integer(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('topics', 'order')
    op.add_column('comprehension_questions', sa.Column('options', sqlite.JSON(), nullable=True))
    op.add_column('comprehension_questions', sa.Column('correct_answer', sa.INTEGER(), nullable=True))
    op.add_column('comprehension_questions', sa.Column('question_type', sa.VARCHAR(length=20), nullable=True))
    # ### end Alembic commands ###
