-- Migration: Online Session — launch mode + join window
-- Description: Adds two admin-configurable columns to hdb_online_session:
--                launch_mode               — where attendees launch from
--                                            ('sdk' embedded Web SDK | 'zoomClient').
--                join_opens_minutes_before — minutes before start the join link
--                                            opens (NULL → app default of 15).
--              Both are nullable; existing rows keep platform defaults at read time.
-- Idempotent — safe to re-run.

ALTER TABLE hdb_online_session
  ADD COLUMN IF NOT EXISTS launch_mode               VARCHAR(30) NULL,
  ADD COLUMN IF NOT EXISTS join_opens_minutes_before SMALLINT    NULL;

COMMENT ON COLUMN hdb_online_session.launch_mode IS
  'Where attendees launch the session: ''sdk'' (embedded Zoom Web SDK) or ''zoomClient'' (Zoom client/web). NULL → sdk at read time.';
COMMENT ON COLUMN hdb_online_session.join_opens_minutes_before IS
  'Minutes before session start that the join link opens. NULL → platform default (15).';
