From 3fe26f4c79333858f85824b35360e08558680af3 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 9 Feb 2016 13:50:28 +1300 Subject: [PATCH] CRM-17999 add index to civicrm_contribution.contribution_source Change-Id: Ia187634fa7b58c63a365f652894e7f3bb298ec35 --- CRM/Upgrade/Incremental/php/FourSeven.php | 13 +++++++++++++ xml/schema/Contribute/Contribution.xml | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index 7d6a32749b..5ea8cbab8d 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -162,6 +162,7 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base public function upgrade_4_7_2($rev) { $this->addTask('Fix Index on civicrm_financial_item combined entity_id + entity_table', 'addCombinedIndexFinancialItemEntityIDEntityType'); $this->addTask('enable financial account relationships for chargeback & refund', 'addRefundAndChargeBackAccountsIfNotExist'); + $this->addTask('Add Index to civicrm_contribution.source', 'addIndexContributionSource'); } /** @@ -487,4 +488,16 @@ FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id"; return TRUE; } + /** + * CRM-17999 Add index to civicrm_contribution.source. + * + * @param \CRM_Queue_TaskContext $ctx + * + * @return bool + */ + public function addIndexContributionSource(CRM_Queue_TaskContext $ctx) { + CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contribution' => array('source'))); + return TRUE; + } + } diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index 614db5b340..0e84514dec 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -309,6 +309,11 @@ Text + + index_source + source + 4.7 + amount_level Amount Label -- 2.25.1