-- Allow jobs referenced by a remote session to be deleted/reaped: -- orphaned-session references are cleared instead of blocking the job removal. ALTER TABLE remote_sessions DROP CONSTRAINT remote_sessions_job_id_fkey, ADD CONSTRAINT remote_sessions_job_id_fkey FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE SET NULL;