Skip to content

Commit

Permalink
Added FK constraint to SQL table
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersoncasimir committed Mar 14, 2024
1 parent 6b772de commit 993a1c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SQL/New_patches/2024-01-30-HED-Tag-Support.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ CREATE TABLE `bids_event_dataset_mapping` (
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
CONSTRAINT `FK_bids_event_dataset_mapping_pair` FOREIGN KEY (`PairRelID`)
REFERENCES `bids_event_dataset_mapping` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
INDEX idx_event_dataset_PropertyName_PropertyValue (`PropertyName`, `PropertyValue`),
CONSTRAINT `FK_project_id` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_dataset_hed_tag_id` FOREIGN KEY (`HEDTagID`) REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
Expand All @@ -89,6 +91,8 @@ CREATE TABLE `bids_event_file_mapping` (
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
CONSTRAINT `FK_bids_event_file_mapping_pair` FOREIGN KEY (`PairRelID`)
REFERENCES `bids_event_file_mapping` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
INDEX idx_event_file_PropertyName_PropertyValue (`PropertyName`, `PropertyValue`),
CONSTRAINT `FK_event_mapping_file_id` FOREIGN KEY (`EventFileID`) REFERENCES `physiological_event_file` (`EventFileID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_file_hed_tag_id` FOREIGN KEY (`HEDTagID`) REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
Expand Down

0 comments on commit 993a1c5

Please sign in to comment.