From e37ce8b23b91be13fe6d3307489161e7f4e50cea Mon Sep 17 00:00:00 2001 From: regisoc Date: Sun, 22 Jan 2023 16:21:36 -0500 Subject: [PATCH 1/2] Add new table to track EEG additional events --- SQL/0000-00-05-ElectrophysiologyTables.sql | 15 ++++++++++++++- .../2022-11-22-eeg-additional-events-table.sql | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 SQL/New_patches/2022-11-22-eeg-additional-events-table.sql diff --git a/SQL/0000-00-05-ElectrophysiologyTables.sql b/SQL/0000-00-05-ElectrophysiologyTables.sql index 8e73716f41c..a6c5d731f1b 100644 --- a/SQL/0000-00-05-ElectrophysiologyTables.sql +++ b/SQL/0000-00-05-ElectrophysiologyTables.sql @@ -144,7 +144,7 @@ CREATE TABLE `physiological_channel` ( CREATE TABLE `physiological_electrode_type` ( `PhysiologicalElectrodeTypeID` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT, `ElectrodeType` VARCHAR(50) NOT NULL UNIQUE, - PRIMARY KEY (`PhysiologicalElectrodeTypeID`) + PRIMARY KEY (`PhysiologicalElectrodeTypeID`)= ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create physiological_electrode_material table @@ -205,6 +205,19 @@ CREATE TABLE `physiological_task_event` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- Create `physiological_task_event_opt` table +-- tracks additional events from bids archives +CREATE TABLE `physiological_task_event_opt` ( + `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `PhysiologicalTaskEventID` int(10) unsigned NOT NULL, + `TaskName` varchar(50) NOT NULL, + `TaskValue` varchar(255) NULL, + PRIMARY KEY (`ID`), + CONSTRAINT `FK_event_task_opt` + FOREIGN KEY (`PhysiologicalTaskEventID`) + REFERENCES `physiological_task_event` (`PhysiologicalTaskEventID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- Create physiological_archive which will store archives of all the files for -- Front-end download diff --git a/SQL/New_patches/2022-11-22-eeg-additional-events-table.sql b/SQL/New_patches/2022-11-22-eeg-additional-events-table.sql new file mode 100644 index 00000000000..b8bf0db0efb --- /dev/null +++ b/SQL/New_patches/2022-11-22-eeg-additional-events-table.sql @@ -0,0 +1,12 @@ +-- Create `physiological_task_event_opt` table +-- tracks additional events from bids archives +CREATE TABLE `physiological_task_event_opt` ( + `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `PhysiologicalTaskEventID` int(10) unsigned NOT NULL, + `TaskName` varchar(50) NOT NULL, + `TaskValue` varchar(255) NULL, + PRIMARY KEY (`ID`), + CONSTRAINT `FK_event_task_opt` + FOREIGN KEY (`PhysiologicalTaskEventID`) + REFERENCES `physiological_task_event` (`PhysiologicalTaskEventID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file From 24347152c944b80c9605ad08e72b257c14123a23 Mon Sep 17 00:00:00 2001 From: regisoc Date: Mon, 23 Jan 2023 15:01:22 -0500 Subject: [PATCH 2/2] remove wrong '=' --- SQL/0000-00-05-ElectrophysiologyTables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQL/0000-00-05-ElectrophysiologyTables.sql b/SQL/0000-00-05-ElectrophysiologyTables.sql index a6c5d731f1b..cb5adbd233e 100644 --- a/SQL/0000-00-05-ElectrophysiologyTables.sql +++ b/SQL/0000-00-05-ElectrophysiologyTables.sql @@ -144,7 +144,7 @@ CREATE TABLE `physiological_channel` ( CREATE TABLE `physiological_electrode_type` ( `PhysiologicalElectrodeTypeID` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT, `ElectrodeType` VARCHAR(50) NOT NULL UNIQUE, - PRIMARY KEY (`PhysiologicalElectrodeTypeID`)= + PRIMARY KEY (`PhysiologicalElectrodeTypeID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create physiological_electrode_material table