-- Add presence fields to profiles for Online-Status feature.
--
-- last_seen_at: Nullable, no default — NULL means "never seen" (accounts before this migration).
--   Updated via POST /api/me/last-seen (Heartbeat, Phase 1).
--   Phase 2: Supabase Edge-Function on presence-leave replaces the heartbeat.
--
-- presence_visible: opt-out toggle for online status visibility.
--   Default true — user can disable via POST /api/me/presence-visibility.
--   When false: last_seen_at is never exposed to other users.

ALTER TABLE "rebreak"."profiles" ADD COLUMN "last_seen_at" TIMESTAMP(3);
ALTER TABLE "rebreak"."profiles" ADD COLUMN "presence_visible" BOOLEAN NOT NULL DEFAULT true;
