I am trying to upgrade from CiviCRM 5.31.1 to 5.57.1 with Drupal 9. I am running MySQL 5.7.41.
I downloaded the new version of CiviCRM with Composer. I then used CV to execute upgrade:db.
The upgrade started normally read out 46 dots under "Executing upgrade..." and then printed "Error executing task "Fix dangerous delete cascade." The remainder of the error is In Error.php line 955: DB Error: unknown error.
When looking at the log in ConfigAndLog I find:
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => exceptionHandler
)
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => ALTER TABLE `civicrm_activity` ADD CONSTRAINT `FK_civicrm_activity_original_id` FOREIGN KEY (`original_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE SET NULL [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'activity_date_time' at row 2037]
[type] => DB_Error
[user_info] => ALTER TABLE `civicrm_activity` ADD CONSTRAINT `FK_civicrm_activity_original_id` FOREIGN KEY (`original_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE SET NULL [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'activity_date_time' at row 2037]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="ALTER TABLE `civicrm_activity` ADD CONSTRAINT `FK_civicrm_activity_original_id` FOREIGN KEY (`original_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE SET NULL [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'activity_date_time' at row 2037]"]
)
I have Googled this and I see a few things for MySQL but I am not sure how to apply them. I cannot find anything close for CiviCRM and nothing directly related for Pear either.
I would appreciate help figuring this out.
Thanks!