SET @system_user_role_id := (SELECT `id` FROM `ohrm_user_role` WHERE `name` = 'SYSTEM');
SET @system_user_id := (SELECT `id` FROM `ohrm_user` WHERE `user_role_id` = @system_user_role_id);
SET @attendance_folder_id := (SELECT id FROM ohrm_report_folder WHERE name = 'Attendance');

UPDATE `ohrm_advanced_report`
SET `folder_id` = @attendance_folder_id, `custom_url` = 'report_view({"id": "Summarized_Attendance_Report", "filters": null})', `created_by`= @system_user_id
WHERE `unique_name` = 'Summarized_Attendance_Report';

INSERT INTO `ohrm_config` (`property`, `value`) VALUES ('threshold_to_late_arrival', '0') ;

-- Removed the older views that are incompatible after the work schedule feature introduced in 7.12