-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[issue_tracker - raisinbread/tools] Fix issue tracker history wrong m…
…odule ID (#8677) This single use tool https://github.com/aces/Loris/blob/main/tools/single_use/Convert_LorisMenuID_to_ModuleID.php failed to convert the now deprecated LorisMenuID to the current modules table ModuleID for rows in issues_history table. The histories now refer to old LorisMenuIDs which map to the wrong module in the new modules table. This fixes this discrepancy by providing a patch, fixing the raisinbread dataset , and updating the conversion tool. How this should be used for existing projects: - If project upgraded to 23.0 and so already ran the Convert_LorisMenuID_to_ModuleID.php script, the project should run the patch SQL/New_patches/2023-04-25-FixIssueWrongModuleID.sql
- Loading branch information
1 parent
18707d1
commit 32ef64d
Showing
2 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- NOTE: This SQL patch follows up the running of single use tool `tools/single_use/Convert_LorisMenuID_to_ModuleID.php` | ||
-- that was necessary to upgrade the `issues` table from LORIS version 22 to version 23. The tool forgot | ||
-- to include an upgrade of the `issues_history` table, which is now tackled by this SQL patch. | ||
|
||
-- delete from issues_history any orphaned module IDs | ||
DELETE FROM issues_history WHERE fieldChanged='module' AND issueID IN (SELECT issueID FROM issues WHERE module IS NULL); | ||
-- set issues history module ID to correct moduleID, replacing old LorisMenu ID | ||
UPDATE issues_history ih SET newValue=(SELECT i.module FROM issues i WHERE i.issueID=ih.issueID) WHERE fieldChanged='module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters