Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.6
-
Fix Version/s: 4.4.7
-
Component/s: None
-
Labels:None
-
Documentation Required?:None
Description
This may affect more upgrade locations but on mysql 5.6.17 I was unable to run the upgrade line
ALTER TABLE `civicrm_participant`
CHANGE COLUMN `event_id` `event_id` INT(10) UNSIGNED NOT NULL,
CHANGE COLUMN `contact_id` `contact_id` INT(10) UNSIGNED NOT NULL;
EVEN though the table was empty.
This appears to be an integrity tightening in mysql
http://stackoverflow.com/questions/17015844/mysql-5-6-foreign-key-constraint-error-didnt-occur-in-5-5 although it is still not apparent to me why it would be a problem as civicrm contact id column definition is
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique Contact ID',
& the sql is
CHANGE COLUMN `event_id` `event_id` INT(10) UNSIGNED NOT NULL,
However, it seems reasonable to conclude that 'on some versions of mysql this change causes problems' and that it is worth wrapping that line in a foreign key constraints toggle.
Question is whether 4.5 will have further mysql version specific snaffus of this type.
http://forum.civicrm.org/index.php/topic,32254.0.html
I will do a PR for this specific line in 4.4 upgrade script