Files
fleetforge/infrastructure/migrations/0007_remote_sessions_job_fk.sql

7 lines
335 B
SQL

-- 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;