-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CatCombo in Approval Workflow [DHIS2-11518] (#18833)
- Loading branch information
Showing
14 changed files
with
123 additions
and
63 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
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
17 changes: 17 additions & 0 deletions
17
...rg/hisp/dhis/db/migration/2.42/V2_42_22__Add_catCombo_values_to_dataApprovalWorkflows.sql
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,17 @@ | ||
-- DHIS2-11518: Add categoryCombo values to existing data approval workflows | ||
-- For workflows with one or more datasets assigned, assign the catCombo from one of the datasets. | ||
-- (All the datasets in a workflow *should* have the same catCombo but if they don't, we pick a random assigned one.) | ||
-- If no datasets are assigned, assign the default catCombo. | ||
-- | ||
-- Note that pre-existing workflows may have a null catCombo (if they were created | ||
-- before the catCombo column was first added several releases ago) or they may have | ||
-- the defaut catCombo (if they were created since the catCombo column was added). | ||
update dataapprovalworkflow daw | ||
set categorycomboid = coalesce( | ||
(select categorycomboid from dataset ds where daw.workflowid = ds.workflowid limit 1), | ||
(select categorycomboid from categorycombo where name = 'default' limit 1) | ||
) | ||
where categorycomboid is null | ||
or categorycomboid = (select categorycomboid from categorycombo where name = 'default' limit 1); | ||
|
||
alter table dataapprovalworkflow alter column categorycomboid set not null; |
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
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
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
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
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
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
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
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
Oops, something went wrong.