Skip to content

Commit

Permalink
ContributionRecur modified_date should update to current_timestamp on…
Browse files Browse the repository at this point in the history
… update
  • Loading branch information
mattwire committed Sep 23, 2021
1 parent 3f52749 commit 6a53beb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CRM/Contribute/DAO/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:6c94785d608dc72c00b663ee8ad4e180)
* (GenCodeChecksum:0bbc65d5374bc0b2441eb08f75f9605d)
*/

/**
Expand Down Expand Up @@ -454,7 +454,7 @@ public static function &fields() {
'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',
Expand Down
2 changes: 2 additions & 0 deletions CRM/Upgrade/Incremental/sql/5.43.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{* file to handle db changes in 5.43.alpha1 during upgrade *}

ALTER TABLE civicrm_contribution_recur MODIFY COLUMN modified_date DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last updated date for this record. mostly the last time a payment was received';
5 changes: 5 additions & 0 deletions tests/phpunit/api/v3/SyntaxConformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
2 changes: 1 addition & 1 deletion xml/schema/Contribute/ContributionRecur.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<name>modified_date</name>
<title>Modified Date</title>
<type>datetime</type>
<default>CURRENT_TIMESTAMP</default>
<default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
<comment>Last updated date for this record. mostly the last time a payment was received</comment>
<add>1.6</add>
<html>
Expand Down

0 comments on commit 6a53beb

Please sign in to comment.