"""add progress tracking fields

Revision ID: add_progress_tracking
Revises: add_task_mgmt_fields
Create Date: 2026-01-16 15:00:00.000000

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

# revision identifiers, used by Alembic.
revision = 'add_progress_tracking'
down_revision = 'add_task_mgmt_fields'
branch_labels = None
depends_on = None


def upgrade() -> None:
    # Add progress and error columns to projects table
    with op.batch_alter_table('projects', schema=None) as batch_op:
        batch_op.add_column(sa.Column('progress', sa.JSON(), nullable=True))
        batch_op.add_column(sa.Column('error', sa.JSON(), nullable=True))


def downgrade() -> None:
    # Remove progress and error columns from projects table
    with op.batch_alter_table('projects', schema=None) as batch_op:
        batch_op.drop_column('error')
        batch_op.drop_column('progress')
