"""gantt_critical_path

Revision ID: 5a3fdaf3d8f8
Revises: 2b3e3a577edf
Create Date: 2024-12-18 10:15:33.197286

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

# revision identifiers, used by Alembic.
revision = '5a3fdaf3d8f8'
down_revision = '2b3e3a577edf'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_gantt_task', sa.Column('late_start_date', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_gantt_task', sa.Column('late_finish_date', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_gantt_task', sa.Column('total_slack', sa.Integer(), nullable=True, server_default='0'))
    op.create_index(op.f('ix_cmf_gantt_task_late_finish_date'), 'cmf_gantt_task', ['late_finish_date'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_late_start_date'), 'cmf_gantt_task', ['late_start_date'], unique=False)
    op.create_index(op.f('ix_cmf_gantt_task_total_slack'), 'cmf_gantt_task', ['total_slack'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_gantt_task_total_slack'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_late_start_date'), table_name='cmf_gantt_task')
    op.drop_index(op.f('ix_cmf_gantt_task_late_finish_date'), table_name='cmf_gantt_task')
    op.drop_column('cmf_gantt_task', 'total_slack')
    op.drop_column('cmf_gantt_task', 'late_finish_date')
    op.drop_column('cmf_gantt_task', 'late_start_date')
    # ### end Alembic commands ###
