"""ADD id index

Revision ID: bdc6f7395c95
Revises: 88db21968c0d
Create Date: 2022-07-22 21:24:25.261159

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "bdc6f7395c95"
down_revision = "88db21968c0d"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(
        op.f("ix_assigned_student_question_id"),
        "assigned_student_question",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_assigned_student_response_id"),
        "assigned_student_response",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_assignment_id"), "assignment", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_assignment_question_id"),
        "assignment_question",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_assignment_repo_id"), "assignment_repo", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_assignment_test_id"), "assignment_test", ["id"], unique=False
    )
    op.create_index(op.f("ix_course_id"), "course", ["id"], unique=False)
    op.create_index(
        op.f("ix_forum_category_id"), "forum_category", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_forum_post_id"), "forum_post", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_forum_post_comment_id"),
        "forum_post_comment",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_forum_post_upvote_id"),
        "forum_post_upvote",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_lecture_notes_id"), "lecture_notes", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_static_file_id"), "static_file", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_submission_id"), "submission", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_submission_build_id"),
        "submission_build",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_submission_test_result_id"),
        "submission_test_result",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_theia_image_id"), "theia_image", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_theia_image_tag_id"), "theia_image_tag", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_theia_paste_id"), "theia_paste", ["id"], unique=False
    )
    op.create_index(
        op.f("ix_theia_session_id"), "theia_session", ["id"], unique=False
    )
    op.create_index(op.f("ix_user_id"), "user", ["id"], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_user_id"), table_name="user")
    op.drop_index(op.f("ix_theia_session_id"), table_name="theia_session")
    op.drop_index(op.f("ix_theia_paste_id"), table_name="theia_paste")
    op.drop_index(op.f("ix_theia_image_tag_id"), table_name="theia_image_tag")
    op.drop_index(op.f("ix_theia_image_id"), table_name="theia_image")
    op.drop_index(
        op.f("ix_submission_test_result_id"),
        table_name="submission_test_result",
    )
    op.drop_index(
        op.f("ix_submission_build_id"), table_name="submission_build"
    )
    op.drop_index(op.f("ix_submission_id"), table_name="submission")
    op.drop_index(op.f("ix_static_file_id"), table_name="static_file")
    op.drop_index(op.f("ix_lecture_notes_id"), table_name="lecture_notes")
    op.drop_index(
        op.f("ix_forum_post_upvote_id"), table_name="forum_post_upvote"
    )
    op.drop_index(
        op.f("ix_forum_post_comment_id"), table_name="forum_post_comment"
    )
    op.drop_index(op.f("ix_forum_post_id"), table_name="forum_post")
    op.drop_index(op.f("ix_forum_category_id"), table_name="forum_category")
    op.drop_index(op.f("ix_course_id"), table_name="course")
    op.drop_index(op.f("ix_assignment_test_id"), table_name="assignment_test")
    op.drop_index(op.f("ix_assignment_repo_id"), table_name="assignment_repo")
    op.drop_index(
        op.f("ix_assignment_question_id"), table_name="assignment_question"
    )
    op.drop_index(op.f("ix_assignment_id"), table_name="assignment")
    op.drop_index(
        op.f("ix_assigned_student_response_id"),
        table_name="assigned_student_response",
    )
    op.drop_index(
        op.f("ix_assigned_student_question_id"),
        table_name="assigned_student_question",
    )
    # ### end Alembic commands ###
