-- 002_followups.sql -- follow-up rules + interview prep on application ALTER TABLE application ADD COLUMN IF NOT EXISTS follow_up_after_days int NOT NULL DEFAULT 7, ADD COLUMN IF NOT EXISTS last_activity_at timestamptz NOT NULL DEFAULT now(), ADD COLUMN IF NOT EXISTS follow_up_snoozed_until date, ADD COLUMN IF NOT EXISTS interview_prep_artifact_id uuid REFERENCES artifact(id); -- last_activity_at defaults to created_at for existing rows UPDATE application SET last_activity_at = created_at WHERE last_activity_at IS NULL;