"""evatest

Revision ID: 85a17a0a44ee
Revises: 9f9f6f92eddb
Create Date: 2024-11-28 10:15:36.753086

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '85a17a0a44ee'
down_revision = '9f9f6f92eddb'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_testcase_run', sa.Column('params_row_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_testcase_run_params_row_id'), 'cmf_testcase_run', ['params_row_id'], unique=False)
    op.create_foreign_key(None, 'cmf_testcase_run', 'cmf_testcase_params_row', ['params_row_id'], ['id'])
    op.drop_column('cmf_testcase_run_step', 'group')
    op.add_column('cmf_testcycle_testcase_result', sa.Column('cur_testcase_run_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_testcycle_testcase_result_cur_testcase_run_id'), 'cmf_testcycle_testcase_result', ['cur_testcase_run_id'], unique=False)
    op.create_foreign_key(None, 'cmf_testcycle_testcase_result', 'cmf_testcase_run', ['cur_testcase_run_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_testcycle_testcase_result', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_testcycle_testcase_result_cur_testcase_run_id'), table_name='cmf_testcycle_testcase_result')
    op.drop_column('cmf_testcycle_testcase_result', 'cur_testcase_run_id')
    op.add_column('cmf_testcase_run_step', sa.Column('group', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'cmf_testcase_run', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_testcase_run_params_row_id'), table_name='cmf_testcase_run')
    op.drop_column('cmf_testcase_run', 'params_row_id')
    # ### end Alembic commands ###
