...
request__t : requester_id has values
Requester Anonymization Scripts
This query replaces the requester_id value with NULL on the request__t__ table if the request status is Closed or the request row is historical:
UPDATE local_protected.test_request__t__
SET requester_id = NULL
WHERE status LIKE 'Closed%'
OR test_request__t__.__current = false
;
This query replaces the requester_id value with NULL on the request__t table if the request status is Closed:
UPDATE local_protected.test_request__t
SET requester_id = NULL
WHERE status LIKE 'Closed%'
;
This query replaces barcode, firstName, and lastName fields inside the requester object with NULL and replaces the requesterId value with NULL if request status is Closed or request row is historical:
UPDATE local_protected.test_request__
SET jsonb = jsonb_set(
jsonb_set(
jsonb_set(
jsonb_set(
jsonb_set(
jsonb, '{requester,barcode}', 'null'::jsonb, false),
'{requester,firstName}', 'null'::jsonb, false),
'{requester,lastName}', 'null'::jsonb, false),
'{requester,middleName}', 'null'::jsonb, false),
'{requesterId}', 'null'::jsonb, false)
WHERE
(jsonb#>>'{status}' LIKE 'Closed%' OR __current = false)
;
Fines and Fees
-Sharon, Joanne, Ann, Tom, Susan Bristol, and Michelle to review what is needed for purging patron data here
...