"""Task_outcome_configuration_table

Revision ID: 5ecbbfc545ba
Revises: a5d9bbf7b5ac
Create Date: 2025-05-07 11:29:25.237479

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5ecbbfc545ba'
down_revision = 'a5d9bbf7b5ac'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('task_outcome_configuration',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('task_id', sa.String(length=100), nullable=False, comment='Task ID'),
    sa.Column('task_name', sa.String(length=100), nullable=True, comment='Task name'),
    sa.Column('task_transition_map', sa.JSON(), nullable=False, comment='Task transition configuration'),
    sa.Column('transition_map_type', sa.String(length=100), nullable=False, server_default="select", comment='Task transition configuration type'),
    sa.Column('created_by', sa.String(length=100), nullable=False, comment='Created by'),
    sa.Column('tenant', sa.String(length=100), nullable=True, comment='Tenant key'),
    sa.Column('created', sa.DateTime(timezone=True), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('idx_task_id_and_tenant', 'task_outcome_configuration', ['tenant', 'task_id'], unique=False)
    op.create_index(op.f('ix_task_outcome_configuration_task_id'), 'task_outcome_configuration', ['task_id'], unique=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_task_outcome_configuration_task_id'), table_name='task_outcome_configuration')
    op.drop_index('idx_task_id_and_tenant', table_name='task_outcome_configuration')
    op.drop_table('task_outcome_configuration')
    # ### end Alembic commands ###
