diff --git a/CRM/Contribute/DAO/ContributionRecur.php b/CRM/Contribute/DAO/ContributionRecur.php index 4913ac61c717..a1ebe04336be 100644 --- a/CRM/Contribute/DAO/ContributionRecur.php +++ b/CRM/Contribute/DAO/ContributionRecur.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6c94785d608dc72c00b663ee8ad4e180) + * (GenCodeChecksum:5f08744178821ce074d21fe4cdddbdaa) */ /** @@ -97,7 +97,7 @@ class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO { /** * Last updated date for this record. mostly the last time a payment was received * - * @var datetime + * @var timestamp */ public $modified_date; @@ -450,11 +450,11 @@ public static function &fields() { ], 'contribution_recur_modified_date' => [ 'name' => 'modified_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, + 'type' => CRM_Utils_Type::T_TIMESTAMP, 'title' => ts('Modified Date'), 'description' => ts('Last updated date for this record. mostly the last time a payment was received'), 'where' => 'civicrm_contribution_recur.modified_date', - 'default' => 'CURRENT_TIMESTAMP', + 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 'table_name' => 'civicrm_contribution_recur', 'entity' => 'ContributionRecur', 'bao' => 'CRM_Contribute_BAO_ContributionRecur', diff --git a/CRM/Upgrade/Incremental/sql/5.43.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.43.alpha1.mysql.tpl index 0447e9d2b759..943d62201f23 100644 --- a/CRM/Upgrade/Incremental/sql/5.43.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.43.alpha1.mysql.tpl @@ -2,3 +2,6 @@ UPDATE civicrm_msg_template SET is_reserved = 0 WHERE is_reserved IS NULL; ALTER TABLE civicrm_msg_template MODIFY COLUMN `is_reserved` tinyint(4) DEFAULT 0 COMMENT 'is this the reserved message template which we ship for the workflow referenced by workflow_id?'; + +{* https://github.com/civicrm/civicrm-core/pull/21472 *} +ALTER TABLE civicrm_contribution_recur MODIFY COLUMN modified_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last updated date for this record. mostly the last time a payment was received'; diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index b9d496bb9480..9acb59823c72 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -654,6 +654,11 @@ public function getKnownUnworkablesUpdateSingle($entity, $key) { 'definition', ], ], + 'ContributionRecur' => [ + 'break_return' => [ + 'contribution_recur_modified_date', + ], + ], 'Domain' => ['cant_update' => ['domain_version']], 'MembershipBlock' => [ 'cant_update' => [ diff --git a/xml/schema/Contribute/ContributionRecur.xml b/xml/schema/Contribute/ContributionRecur.xml index bc8e0eafe021..10ccc535920a 100644 --- a/xml/schema/Contribute/ContributionRecur.xml +++ b/xml/schema/Contribute/ContributionRecur.xml @@ -143,8 +143,8 @@ modified_date Modified Date - datetime - CURRENT_TIMESTAMP + timestamp + CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP Last updated date for this record. mostly the last time a payment was received 1.6