From fceb7cea66e56a6b3a6408eed3e9868d99dd5064 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Thu, 1 Mar 2018 14:51:58 -0500 Subject: [PATCH] CiviContribute: fix zero value trxn dates that choke upgrades on legacy sites --- CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl index 91e50b0f3e..ee87b96788 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl @@ -41,6 +41,12 @@ INSERT INTO VALUES (@option_group_id_adOpt, {localize}'{ts escape="sql"}Supplemental Address 3{/ts}'{/localize}, (SELECT @max_val := @max_val + 1), 'supplemental_address_3', NULL, 0, NULL, (SELECT @supp2_wt := @supp2_wt + 1), {localize}''{/localize}, 0, 0, 1, NULL, NULL, NULL); +-- Some legacy sites have `0000-00-00 00:00:00` values in +-- `civicrm_financial_trxn.trxn_date` which correspond to the same value in +-- `civicrm_contribution.receive_date` +UPDATE civicrm_financial_trxn SET trxn_date = NULL WHERE trxn_date = '0000-00-00 00:00:00'; +UPDATE civicrm_contribution SET receive_date = NULL WHERE receive_date = '0000-00-00 00:00:00'; + -- CRM-20439 rename card_type to card_type_id of civicrm_financial_trxn table (IIDA-126) ALTER TABLE `civicrm_financial_trxn` CHANGE `card_type` `card_type_id` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to accept_creditcard option group values'; -- 2.25.1