From f9529bbf2d495b64eecb9a9060b79dbb2f12f51f Mon Sep 17 00:00:00 2001 From: cmadjar Date: Thu, 17 Jan 2019 13:02:04 -0500 Subject: [PATCH] [Bug fix] Populate parameter_type_category_rel table with imaging and electrophysiology variables (#4263) This adds an SQL patch to fix the issue that imaging or electrophysiology parameter_type fields are not linked to a parameter type category via the parameter_type_category_rel table. --- SQL/0000-00-00-schema.sql | 3 ++- ...ype_and_parameter_type_category_for_imaging.sql | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 SQL/New_patches/2019-01-16_map_parameter_type_and_parameter_type_category_for_imaging.sql diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index 6a5089c830d..d33721c6843 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -1485,7 +1485,8 @@ CREATE TABLE `parameter_type_category` ( INSERT INTO `parameter_type_category` (Name, Type) VALUES ('MRI Variables','Metavars'), - ('Identifiers', 'Metavars'); + ('Identifiers', 'Metavars'), + ('Electrophysiology Variables', 'Metavars'); CREATE TABLE `parameter_type_category_rel` ( `ParameterTypeID` int(11) unsigned NOT NULL default '0', diff --git a/SQL/New_patches/2019-01-16_map_parameter_type_and_parameter_type_category_for_imaging.sql b/SQL/New_patches/2019-01-16_map_parameter_type_and_parameter_type_category_for_imaging.sql new file mode 100644 index 00000000000..b91347a252b --- /dev/null +++ b/SQL/New_patches/2019-01-16_map_parameter_type_and_parameter_type_category_for_imaging.sql @@ -0,0 +1,14 @@ +INSERT INTO parameter_type_category_rel (ParameterTypeID, ParameterTypeCategoryID) + SELECT DISTINCT ParameterTypeID, ParameterTypeCategoryID + FROM parameter_type, parameter_type_category ptc + WHERE SourceFrom="parameter_file" AND ptc.Name="MRI Variables"; + + +INSERT INTO parameter_type_category (Name, Type) + VALUES ('Electrophysiology Variables', 'Metavars'); + +INSERT INTO parameter_type_category_rel (ParameterTypeID, ParameterTypeCategoryID) + SELECT DISTINCT ParameterTypeID, ParameterTypeCategoryID + FROM parameter_type, parameter_type_category ptc + WHERE SourceFrom="physiological_parameter_file" AND ptc.Name="Electrophysiology Variables"; +