Deletes a contract by id, together with its history rows
(contract_histories) and pivot links
(contract_facility_security_system). Phonebook entries
that pointed at this contract (facility_supervisors.contract_id)
have the reference set to NULL — the supervisor row
itself is kept. Always dry-run first.