-- Migration: Online Session — finalized flag
-- Description: Adds `finalized` to hdb_online_session — set true when the
--              final-session-confirm API (ZoomFinalSessionConfirmService) has
--              been run for a program's final session. Defaults false for all
--              existing rows and any non-final session.
-- Idempotent — safe to re-run.

ALTER TABLE hdb_online_session
  ADD COLUMN IF NOT EXISTS finalized BOOLEAN NOT NULL DEFAULT false;

COMMENT ON COLUMN hdb_online_session.finalized IS
  'True once the final-session-confirm API has been run for this (final) session. Never set for a non-final session.';
