Skip to content

Commit

Permalink
CRM-20958 - Declare created/modified timestamps for case+activity
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Jul 25, 2017
1 parent 638bab7 commit 751e232
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 2 deletions.
46 changes: 45 additions & 1 deletion CRM/Activity/DAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:a530f1fb1a27c5a15b5d138732b4c581)
* (GenCodeChecksum:eca2f832bafaf0b52fc708140d9acac8)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -195,6 +195,18 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
* @var boolean
*/
public $is_star;
/**
* When was the activity was created.
*
* @var timestamp
*/
public $created_date;
/**
* When was the activity (or closely related entity) was created or modified or deleted.
*
* @var timestamp
*/
public $modified_date;
/**
* Class constructor.
*/
Expand Down Expand Up @@ -642,6 +654,38 @@ static function &fields() {
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
) ,
'created_date' => array(
'name' => 'created_date',
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => ts('Created Date') ,
'description' => 'When was the activity was created.',
'required' => false,
'export' => true,
'where' => 'civicrm_activity.created_date',
'headerPattern' => '',
'dataPattern' => '',
'default' => 'NULL',
'table_name' => 'civicrm_activity',
'entity' => 'Activity',
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
) ,
'modified_date' => array(
'name' => 'modified_date',
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => ts('Modified Date') ,
'description' => 'When was the activity (or closely related entity) was created or modified or deleted.',
'required' => false,
'export' => true,
'where' => 'civicrm_activity.modified_date',
'headerPattern' => '',
'dataPattern' => '',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'table_name' => 'civicrm_activity',
'entity' => 'Activity',
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
) ,
);
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
Expand Down
46 changes: 45 additions & 1 deletion CRM/Case/DAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Case/Case.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:e45e7e2a53a945c4659cf393410a9d7a)
* (GenCodeChecksum:7642a118dfb9adbd7ed8a27127c1ee73)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -97,6 +97,18 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO {
* @var boolean
*/
public $is_deleted;
/**
* When was the case was created.
*
* @var timestamp
*/
public $created_date;
/**
* When was the case (or closely related entity) was created or modified or deleted.
*
* @var timestamp
*/
public $modified_date;
/**
* Class constructor.
*/
Expand Down Expand Up @@ -275,6 +287,38 @@ static function &fields() {
'bao' => 'CRM_Case_BAO_Case',
'localizable' => 0,
) ,
'created_date' => array(
'name' => 'created_date',
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => ts('Created Date') ,
'description' => 'When was the case was created.',
'required' => false,
'export' => true,
'where' => 'civicrm_case.created_date',
'headerPattern' => '',
'dataPattern' => '',
'default' => 'NULL',
'table_name' => 'civicrm_case',
'entity' => 'Case',
'bao' => 'CRM_Case_BAO_Case',
'localizable' => 0,
) ,
'modified_date' => array(
'name' => 'modified_date',
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => ts('Modified Date') ,
'description' => 'When was the case (or closely related entity) was created or modified or deleted.',
'required' => false,
'export' => true,
'where' => 'civicrm_case.modified_date',
'headerPattern' => '',
'dataPattern' => '',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'table_name' => 'civicrm_case',
'entity' => 'Case',
'bao' => 'CRM_Case_BAO_Case',
'localizable' => 0,
) ,
);
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
Expand Down
18 changes: 18 additions & 0 deletions xml/schema/Activity/Activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -463,4 +463,22 @@
<headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
<add>4.7</add>
</field>
<field>
<name>created_date</name>
<type>timestamp</type>
<comment>When was the activity was created.</comment>
<required>false</required>
<export>true</export>
<default>NULL</default>
<add>4.7</add>
</field>
<field>
<name>modified_date</name>
<type>timestamp</type>
<comment>When was the activity (or closely related entity) was created or modified or deleted.</comment>
<required>false</required>
<export>true</export>
<default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
<add>4.7</add>
</field>
</table>
18 changes: 18 additions & 0 deletions xml/schema/Case/Case.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,22 @@
<fieldName>is_deleted</fieldName>
<add>2.2</add>
</index>
<field>
<name>created_date</name>
<type>timestamp</type>
<comment>When was the case was created.</comment>
<required>false</required>
<export>true</export>
<default>NULL</default>
<add>4.7</add>
</field>
<field>
<name>modified_date</name>
<type>timestamp</type>
<comment>When was the case (or closely related entity) was created or modified or deleted.</comment>
<required>false</required>
<export>true</export>
<default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
<add>4.7</add>
</field>
</table>

0 comments on commit 751e232

Please sign in to comment.