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);
Die Übersetzung von SQL in Active Record ist noch nicht ganz gelungen.
SQL-Code:
See https://github.com/hitobito/hitobito/issues/1060