-- Migration: Track pre-session presence duration separately
-- Description: duration_seconds previously summed every join/leave interval from a seeker's raw
--              Zoom join time, even time spent present before the session's actual start (e.g. an
--              early joiner or waiting-room admission). duration_seconds now only counts presence
--              from the session's actual start time onward; pre_session_duration_seconds holds the
--              excluded early-presence time so it isn't lost, just reported separately.
-- Idempotent — safe to re-run.

ALTER TABLE zoom_analytics_attendee_summary
  ADD COLUMN IF NOT EXISTS pre_session_duration_seconds INT NOT NULL DEFAULT 0;
