hitobito_pbs icon indicating copy to clipboard operation
hitobito_pbs copied to clipboard

Daily job to delete possible unneeded sensitive information from event applications

Open Michael-Schaer opened this issue 1 year ago • 0 comments

Die Übersetzung von SQL in Active Record ist noch nicht ganz gelungen.

SQL-Code:


UPDATE event_approvals ea
JOIN event_participations ep ON ep.application_id = ea.application_id
JOIN events e ON ep.event_id = [e.id](http://e.id/)
JOIN event_dates ed ON [e.id](http://e.id/) = ed.event_id
SET ea.comment=NULL, ea.current_occupation=NULL,
ea.current_level=NULL, ea.occupation_assessment=NULL,
ea.strong_points=NULL, ea.weak_points=NULL
WHERE ed.id = (SELECT id FROM event_dates WHERE event_id=ed.event_id ORDER BY finish_at DESC LIMIT 1)
AND e.state = 'closed'
AND ed.finish_at < DATE_SUB(CURDATE(), INTERVAL 90 DAY);

Fixes https://github.com/hitobito/hitobito/issues/1060

Michael-Schaer avatar Mar 26 '23 09:03 Michael-Schaer