forked from aces/Loris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Consent] Add ParentID to
consent
for consent grouping (aces#6042)
Adds ConsentGroupID to consent table (schema + patch) This keeps the Consent Status tab rendering the same. Only the back-end is affected in this PR. This feature is increasingly in demand from projects who would like to split up consents via e.g. consent forms. See also aces#6044 for front-end changes.
- Loading branch information
1 parent
0893582
commit d2c1bbb
Showing
6 changed files
with
49 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE `consent_group` ( | ||
`ConsentGroupID` integer unsigned NOT NULL AUTO_INCREMENT, | ||
`Name` varchar(255) NOT NULL, | ||
`Label` varchar(255) NOT NULL, | ||
CONSTRAINT `PK_consent_group` PRIMARY KEY (`ConsentGroupID`), | ||
CONSTRAINT `UK_consent_group_Name` UNIQUE KEY `Name` (`Name`), | ||
CONSTRAINT `UK_consent_group_Label` UNIQUE KEY `Label` (`Label`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
INSERT INTO `consent_group` (`ConsentGroupID`, `Name`, `Label`) VALUES ('1', 'main_consent', 'Main consent'); | ||
|
||
ALTER TABLE `consent` ADD `ConsentGroupID` integer unsigned NOT NULL DEFAULT 1; | ||
ALTER TABLE `consent` ADD CONSTRAINT `FK_consent_ConsentGroupID` FOREIGN KEY (`ConsentGroupID`) REFERENCES `consent_group` (`ConsentGroupID`) ON DELETE RESTRICT ON UPDATE CASCADE; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
SET FOREIGN_KEY_CHECKS=0; | ||
TRUNCATE TABLE `consent`; | ||
LOCK TABLES `consent` WRITE; | ||
INSERT INTO `consent` (`ConsentID`, `Name`, `Label`) VALUES (1,'study_consent','Consent to Study'); | ||
INSERT INTO `consent` (`ConsentID`, `Name`, `Label`) VALUES (2,'raisin_consent','Consent to Raisin'); | ||
INSERT INTO `consent` (`ConsentID`, `Name`, `Label`) VALUES (3,'bread_consent','Consent to Bread'); | ||
INSERT INTO `consent` (`ConsentID`, `Name`, `Label`, `ConsentGroupID`) VALUES (1,'study_consent','Consent to Study', '1'); | ||
INSERT INTO `consent` (`ConsentID`, `Name`, `Label`, `ConsentGroupID`) VALUES (2,'raisin_consent','Consent to Raisin', '2'); | ||
INSERT INTO `consent` (`ConsentID`, `Name`, `Label`, `ConsentGroupID`) VALUES (3,'bread_consent','Consent to Bread', '2'); | ||
UNLOCK TABLES; | ||
SET FOREIGN_KEY_CHECKS=1; |
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,7 @@ | ||
SET FOREIGN_KEY_CHECKS=0; | ||
TRUNCATE TABLE `consent_group`; | ||
LOCK TABLES `consent_group` WRITE; | ||
INSERT INTO `consent_group` (`ConsentGroupID`, `Name`, `Label`) VALUES (1,'study_consent_form','Study Information and Consent Form'); | ||
INSERT INTO `consent_group` (`ConsentGroupID`, `Name`, `Label`) VALUES (2,'bakery_consent_form','Bakery Information and Consent Form'); | ||
UNLOCK TABLES; | ||
SET FOREIGN_KEY_CHECKS=1; |