-- file-lifecycle-auditor M1: `files.client_id` had no explicit
-- `ON DELETE` (defaulted to NO ACTION), so any future bulk-client-delete
-- or port-teardown that bypassed `hardDeleteClient` would FK-violate.
-- Sister columns `files.yacht_id` and `files.company_id` were already
-- SET NULL in migration 0042; bring `files.client_id` to parity so the
-- "hard-delete is the only legal path" invariant becomes explicit.
--
-- The existing `client-hard-delete.service.ts` nullifies these FKs
-- explicitly before the client DELETE; that pre-step is now redundant
-- but harmless, so we don't remove it (defense in depth).

ALTER TABLE files
  DROP CONSTRAINT IF EXISTS files_client_id_clients_id_fk;

ALTER TABLE files
  ADD CONSTRAINT files_client_id_clients_id_fk
  FOREIGN KEY (client_id) REFERENCES clients(id)
  ON DELETE SET NULL;
