"""Add progress tracking columns to the tasks table.

Enables the pSEO Engine dashboard to show live progress during article
generation jobs: a progress bar (current/total) and an error log for
per-article failures without aborting the whole run.
"""


def up(conn) -> None:
    conn.execute(
        "ALTER TABLE tasks ADD COLUMN progress_current INTEGER NOT NULL DEFAULT 0"
    )
    conn.execute(
        "ALTER TABLE tasks ADD COLUMN progress_total INTEGER NOT NULL DEFAULT 0"
    )
    conn.execute(
        "ALTER TABLE tasks ADD COLUMN error_log TEXT NOT NULL DEFAULT '[]'"
    )
