Skip to content

Commit

Permalink
CRM-20958 - On upgrade, declare created/modified timestamps for case+…
Browse files Browse the repository at this point in the history
…activity
  • Loading branch information
totten committed Jul 26, 2017
1 parent 751e232 commit 014093f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CRM/Upgrade/Incremental/php/FourSeven.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,26 @@ public function upgrade_4_7_23($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
}

/**
* Upgrade function.
*
* @param string $rev
*/
public function upgrade_4_7_24($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);

$this->addTask('CRM-20958 - Add created_date to civicrm_activity', 'addColumn',
'civicrm_activity', 'created_date', "timestamp NULL DEFAULT NULL COMMENT 'When was the activity was created.'");
$this->addTask('CRM-20958 - Add modified_date to civicrm_activity', 'addColumn',
'civicrm_activity', 'modified_date', "timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When was the activity (or closely related entity) was created or modified or deleted.'");
$this->addTask('CRM-20958 - Add created_date to civicrm_case', 'addColumn',
'civicrm_case', 'created_date', "timestamp NULL DEFAULT NULL COMMENT 'When was the case was created.'");
$this->addTask('CRM-20958 - Add modified_date to civicrm_case', 'addColumn',
'civicrm_case', 'modified_date', "timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When was the case (or closely related entity) was created or modified or deleted.'");

return TRUE;
}

/*
* Important! All upgrade functions MUST add a 'runSql' task.
* Uncomment and use the following template for a new upgrade version
Expand Down

0 comments on commit 014093f

Please sign in to comment.