[Loris-dev] Help: MaxCenters = 255
Morales Pinzon, Alfredo
AMORALESPINZON at bwh.harvard.edu
Tue Aug 22 14:32:47 EDT 2017
Dear LORIS team and users,
I was testing the insertion of Centers and I got an error referring to the CenterID of table psc. This CenterID is defined as a tinyint(2) and has a maximum value of 255 (see https://dev.mysql.com/doc/refman/5.7/en/integer-types.html). In my project, we will handle hundreds of Centers. Is it possible to easily migrate the database to change this CenterID as SMALL INT or MEDIUM INT?
Here is the error:
mysql> insert into psc(Name,Alias,MRI_Alias) values ('test_1238-UCD','CAB','CAB');
ERROR 1062 (23000): Duplicate entry '255' for key 'PRIMARY'
mysql> describe psc;
+------------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------------+------+-----+---------+----------------+
| CenterID | tinyint(2) unsigned | NO | PRI | NULL | auto_increment |
| Name | varchar(150) | NO | UNI | | |
| PSCArea | varchar(150) | YES | | NULL | |
| Address | varchar(150) | YES | | NULL | |
| City | varchar(150) | YES | | NULL | |
| StateID | tinyint(2) unsigned | YES | | NULL | |
| ZIP | varchar(12) | YES | | NULL | |
| Phone1 | varchar(12) | YES | | NULL | |
| Phone2 | varchar(12) | YES | | NULL | |
| Contact1 | varchar(150) | YES | | NULL | |
| Contact2 | varchar(150) | YES | | NULL | |
| Alias | char(3) | NO | | | |
| MRI_alias | varchar(4) | NO | | | |
| Account | varchar(8) | YES | | NULL | |
| Study_site | enum('N','Y') | YES | | Y | |
+------------+---------------------+------+-----+---------+----------------+
15 rows in set (0.01 sec)
Regards,
Alfredo Morales Pinzon
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20170822/1fcba4c5/attachment.html>
More information about the Loris-dev
mailing list