-- Migration: Guidelines PDF URL columns
-- Description: Adds guidelines_pdf_url to program and program_session. Holds the cached S3 URL
--              of the generated guidelines PDF — program-level (one per program, populated on
--              the first Welcome send) and session-level (one per session, populated on the
--              first Invite send). Both nullable; null = not generated yet. Idempotent.

ALTER TABLE program_v1
    ADD COLUMN IF NOT EXISTS guidelines_pdf_url TEXT NULL;

COMMENT ON COLUMN program_v1.guidelines_pdf_url IS
    'Cached S3 URL of the program-level session-guidelines PDF; generated lazily on the first Welcome send. Null = not generated yet.';

ALTER TABLE program_session
    ADD COLUMN IF NOT EXISTS guidelines_pdf_url TEXT NULL;

COMMENT ON COLUMN program_session.guidelines_pdf_url IS
    'Cached S3 URL of the session-level guidelines PDF; generated lazily on the first Invite send for the session. Null = not generated yet.';
