BEGIN; -- Existing sessions keep their current idle deadline: expired sessions stay expired. -- Their original issuance time was not recorded, so the new absolute cap starts here. ALTER TABLE project_sessions ADD COLUMN created_at timestamptz NOT NULL DEFAULT now(), ADD COLUMN absolute_expires_at timestamptz NOT NULL DEFAULT (now() + interval '90 days'); COMMIT;