"""add workplan file backing metadata for remote API index

Revision ID: f1a2b3c4d5e6
Revises: e9f0a1b2c3d4
Create Date: 2026-07-03

"""
from alembic import op
import sqlalchemy as sa

revision = "f1a2b3c4d5e6"
down_revision = "e9f0a1b2c3d4"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column("workplans", sa.Column("backing_filename", sa.String(255), nullable=True))
    op.add_column("workplans", sa.Column("backing_relative_path", sa.Text(), nullable=True))
    op.add_column("workplans", sa.Column("backing_archived", sa.Boolean(), nullable=True))
    op.add_column(
        "workplans",
        sa.Column("backing_synced_at", sa.DateTime(timezone=True), nullable=True),
    )


def downgrade() -> None:
    op.drop_column("workplans", "backing_synced_at")
    op.drop_column("workplans", "backing_archived")
    op.drop_column("workplans", "backing_relative_path")
    op.drop_column("workplans", "backing_filename")