-- One row per account whose arrival as a direct disciple of Śrīla Prabhupāda -- has been announced to the community. -- -- This table exists purely for idempotency. Announcing writes a notification -- to *every* user, so it must happen at most once per devotee — not again when -- an admin corrects which disciple record they're linked to, not again on a -- double-clicked button, and not again if the process restarts mid-fan-out. -- The insert is `ON CONFLICT DO NOTHING` and only a caller that actually -- inserted the row goes on to broadcast, which makes the guard atomic. -- -- Keyed on user_id (not disciple_id) deliberately: we are announcing that a -- *person* has joined. Re-pointing their link at a different disciple record -- corrects a mistake; it isn't a second arrival. CREATE TABLE IF NOT EXISTS disciple_announcements ( user_id UUID PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE, -- The Mongo disciple ObjectID they were linked to at announcement time, -- kept for auditing (which record prompted the announcement). disciple_id TEXT NOT NULL, announced_at TIMESTAMPTZ NOT NULL DEFAULT now() );