processmaker
processmaker copied to clipboard
FOUR-18613 populate cases_participated table with existing requests
Issue & Reproduction Steps
Create and upgrade the script to populate the cases_participated table with the existing requests in production environments.
Related Tickets & Packages
Code Review Checklist
- [ ] I have pulled this code locally and tested it on my instance, along with any associated packages.
- [ ] This code adheres to ProcessMaker Coding Guidelines.
- [ ] This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
- [ ] This solution fixes the bug reported in the original ticket.
- [ ] This solution does not alter the expected output of a component in a way that would break existing Processes.
- [ ] This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
- [ ] This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
- [ ] This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
- [ ] This ticket conforms to the PRD associated with this part of ProcessMaker.
Hello @devmiguelangel added a diff about cases_participated upgrade vs default insert sql query Upgrade
`INSERT INTO `cases_participated` (`id`, `user_id`, `case_number`, `case_title`, `case_title_formatted`, `case_status`, `processes`, `requests`, `request_tokens`, `tasks`, `participants`, `initiated_at`, `completed_at`, `created_at`, `updated_at`, `keywords`) VALUES
(1, 1, 1, 'Case #1', 'Case #<b>1</b>', 'IN_PROGRESS', '[{\"id\": 2, \"name\": \"basic Process\"}]', '[{\"id\": 1, \"name\": \"basic Process\", \"parent_request_id\": null}]', '[2, 3]', '[{\"id\": 2, \"name\": \"Form Task\", \"element_id\": \"node_2\", \"process_id\": 2}, {\"id\": 3, \"name\": \"Form Task\", \"element_id\": \"node_12\", \"process_id\": 2}]', '[1]', '2024-10-10 21:19:04', NULL, '2024-10-10 21:19:04', '2024-10-10 21:19:08', 'cn_1 Case #1');`
Default
`INSERT INTO `cases_participated` (`id`, `user_id`, `case_number`, `case_title`, `case_title_formatted`, `case_status`, `processes`, `requests`, `request_tokens`, `tasks`, `participants`, `initiated_at`, `completed_at`, `created_at`, `updated_at`, `keywords`) VALUES
(1, 1, 1, 'Case #1', 'Case #<b>1</b>', 'IN_PROGRESS', '[{\"id\": 2, \"name\": \"basic Process\"}]', '[{\"id\": 1, \"name\": \"basic Process\", \"parent_request_id\": null}]', '[2, 3]', '[{\"id\": 2, \"name\": \"Form Task\", \"element_id\": \"node_2\", \"process_id\": 2}, {\"id\": 3, \"name\": \"Form Task\", \"element_id\": \"node_12\", \"process_id\": 2}]', '[1]', '2024-10-10 21:19:04', NULL, '2024-10-10 21:19:05', '2024-10-10 21:19:11', 'Case #1');`
Review the dateTime columns and the keyword appear to be different
@rodriquelca about this comment
I've fixed the store and update of the keywords column.