Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQL] Setting default value of ScannerID in mri_protocol to be NULL instead of 0 #7496

Merged
merged 3 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ core section.***
- ***When possible please provide the number of the pull request(s) containing the
changes in the following format: PR #1234***

##LORIS 24.0 (Release Date: ??)
## LORIS 24.0 (Release Date: ??)
### Core
- New classes to describe a data dictionary (PR #6938)
#### Features
Expand All @@ -24,8 +24,9 @@ requesting a new account and will be displayed in the User Accounts module (PR #
- Candidate's age can be retrieved from the Candidate class in days, months, or years (PR #5945)
- Addition of autoSelect prop to React SelectElement allows for auto-selection of only available select option (PR #6156)
- An `AcquisitionDate` field has been added to the `files` table (PR #6892)
- The default value of the ScannerID field of the mri_protocol table is now NULL instead of 0 (PR #7496).
#### Bug Fixes
- *Add item here*
- The default value of the `ScannerID` field of the `mri_protocol` table is now `NULL` instead of `0`. This means that if a protocol is valid on all the study's scanners, then `ScannerID` of the protocol should be set to `NULL` (PR #7496)
### Modules
#### Help Editor
- Cleaned up the deprecated column `Parent Topic` (PR #7025)
Expand Down
2 changes: 1 addition & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ INSERT INTO `mri_protocol_group` (`Name`) VALUES('Default MRI protocol group');
CREATE TABLE `mri_protocol` (
`ID` int(11) unsigned NOT NULL auto_increment,
`Center_name` varchar(4) NOT NULL default '',
`ScannerID` int(10) unsigned NOT NULL default '0',
`ScannerID` int(10) unsigned default NULL,
`Scan_type` int(10) unsigned NOT NULL default '0',
`TR_min` DECIMAL(10,4) DEFAULT NULL,
`TR_max` DECIMAL(10,4) DEFAULT NULL,
Expand Down
2 changes: 2 additions & 0 deletions SQL/New_patches/2021-06-23_set_default_ScannerID_to_NULL.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE mri_protocol MODIFY ScannerID int(10) unsigned default NULL;
UPDATE mri_protocol SET ScannerID=NULL WHERE ScannerID=0;
14 changes: 7 additions & 7 deletions raisinbread/RB_files/RB_mri_protocol.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE `mri_protocol`;
LOCK TABLES `mri_protocol` WRITE;
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1004,'ZZZZ',0,63,347.0000,667.0000,5.1900,7.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1005,'ZZZZ',0,44,2400.0000,2400.0000,2.0000,4.0000,1200.0000,1200.0000,0.9700,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1006,'ZZZZ',0,45,3200.0000,3200.0000,384.0000,528.0000,NULL,NULL,1.0000,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1007,'ZZZZ',0,40,2500.0000,2500.0000,27.0000,27.0000,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,130,130,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1008,'ZZZZ',0,66,10404.0000,14600.0000,88.0000,102.0000,NULL,NULL,2.0000,3.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,25,27,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1009,'ZZZZ',0,65,10200.0000,13000.0000,88.0000,105.0000,NULL,NULL,2.0000,2.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,65,66,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1010,'ZZZZ',0,64,489.0000,489.0000,3.1900,5.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1004,'ZZZZ',NULL,63,347.0000,667.0000,5.1900,7.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1005,'ZZZZ',NULL,44,2400.0000,2400.0000,2.0000,4.0000,1200.0000,1200.0000,0.9700,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1006,'ZZZZ',NULL,45,3200.0000,3200.0000,384.0000,528.0000,NULL,NULL,1.0000,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1007,'ZZZZ',NULL,40,2500.0000,2500.0000,27.0000,27.0000,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,130,130,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1008,'ZZZZ',NULL,66,10404.0000,14600.0000,88.0000,102.0000,NULL,NULL,2.0000,3.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,25,27,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1009,'ZZZZ',NULL,65,10200.0000,13000.0000,88.0000,105.0000,NULL,NULL,2.0000,2.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,65,66,NULL,NULL,1);
INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1010,'ZZZZ',NULL,64,489.0000,489.0000,3.1900,5.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1);
UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1;