From df6a943032ed553fc6e4c3a7e1c44f5d37b39728 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 26 Dec 2014 19:57:37 +0530 Subject: [PATCH] additional comments --- CRM/Upgrade/Incremental/php/FourSix.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/FourSix.php b/CRM/Upgrade/Incremental/php/FourSix.php index 6676062ba3..0e94e841d1 100644 --- a/CRM/Upgrade/Incremental/php/FourSix.php +++ b/CRM/Upgrade/Incremental/php/FourSix.php @@ -114,19 +114,21 @@ class CRM_Upgrade_Incremental_php_FourSix { function upgrade_4_6_alpha3($rev) { // task to process sql - $this->addTask(ts('Adding column reference date and updating with '), 'updateReferenceDate'); + $this->addTask(ts('Adding and updating column reference_date for Schedule Reminders'), 'updateReferenceDate'); } // CRM-15728, Add new column reference_date to civicrm_action_log in order to track // actual action_start_date for membership entity for only those schedule reminders which are not repeatable static function updateReferenceDate(CRM_Queue_TaskContext $ctx) { + //Add column civicrm_action_log.reference_date $query = "ALTER TABLE `civicrm_action_log` ADD COLUMN `reference_date` date COMMENT 'Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)'"; CRM_Core_DAO::executeQuery($query); + //Retrieve schedule reminders for membership entity and is not repeatable $query = "SELECT schedule.* FROM civicrm_action_schedule schedule LEFT JOIN civicrm_action_mapping mapper ON mapper.id = schedule.mapping_id AND - mapper.entity = 'civicrm_membership' AND is_repeat = 0"; + mapper.entity = 'civicrm_membership' AND schedule.is_repeat = 0"; $dao = CRM_Core_DAO::executeQuery($query); while($dao->fetch()) { if (empty($dao->start_action_date)) { @@ -159,7 +161,6 @@ class CRM_Upgrade_Incremental_php_FourSix { $sql = "UPDATE civicrm_action_log reminder LEFT JOIN civicrm_membership m ON reminder.entity_id = m.id SET reminder.reference_date = {$referenceColumn} - WHERE " . implode(" AND ", $where); CRM_Core_DAO::executeQuery($sql); } -- 2.25.1