"""gantt_variance

Revision ID: 69f3ed63d048
Revises: eae026dd7749
Create Date: 2025-11-13 09:00:43.420423

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '69f3ed63d048'
down_revision = 'eae026dd7749'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_gantt_task', sa.Column('start_variance', sa.Integer(), nullable=True, server_default='0'))
    op.add_column('cmf_gantt_task', sa.Column('finish_variance', sa.Integer(), nullable=True, server_default='0'))
    op.add_column('cmf_gantt_task', sa.Column('duration_variance', sa.Integer(), nullable=True, server_default='0'))
    op.add_column('cmf_gantt_task', sa.Column('baseline_start_date', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_gantt_task', sa.Column('baseline_finish_date', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_gantt_task', sa.Column('baseline_duration', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_cmf_gantt_task_baseline_duration'), 'cmf_gantt_task', ['baseline_duration'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_baseline_finish_date'), 'cmf_gantt_task', ['baseline_finish_date'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_baseline_start_date'), 'cmf_gantt_task', ['baseline_start_date'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_duration_variance'), 'cmf_gantt_task', ['duration_variance'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_finish_variance'), 'cmf_gantt_task', ['finish_variance'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_start_variance'), 'cmf_gantt_task', ['start_variance'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_gantt_task_start_variance'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_finish_variance'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_duration_variance'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_baseline_start_date'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_baseline_finish_date'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_baseline_duration'), table_name='cmf_gantt_task')
    op.drop_column('cmf_gantt_task', 'baseline_duration')
    op.drop_column('cmf_gantt_task', 'baseline_finish_date')
    op.drop_column('cmf_gantt_task', 'baseline_start_date')
    op.drop_column('cmf_gantt_task', 'duration_variance')
    op.drop_column('cmf_gantt_task', 'finish_variance')
    op.drop_column('cmf_gantt_task', 'start_variance')
    # ### end Alembic commands ###
