"""Migration 0022: Add response tracking columns to lead_forwards."""

FORWARD_STATUSES = ["sent", "viewed", "contacted", "quoted", "won", "lost", "no_response"]


def up(conn) -> None:
    conn.execute("ALTER TABLE lead_forwards ADD COLUMN status_updated_at TEXT")
    conn.execute("ALTER TABLE lead_forwards ADD COLUMN supplier_note TEXT")
    conn.execute("ALTER TABLE lead_forwards ADD COLUMN cta_token TEXT")
    conn.execute(
        "CREATE UNIQUE INDEX IF NOT EXISTS idx_lead_forwards_cta_token ON lead_forwards(cta_token) WHERE cta_token IS NOT NULL"
    )
