From 8ca47f5c183958dd409d86f56aaf0dbc0ba8f8e0 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 28 Jan 2016 07:58:00 +1300 Subject: [PATCH] CRM-17882 Add index to civicrm_contribution.credit_note_id Change-Id: I5ad63820a3df93995ebd65ec76a8b3aac87ba1c6 --- CRM/Upgrade/Incremental/php/FourSeven.php | 22 ++++++++++++++++++++++ xml/schema/Contribute/Contribution.xml | 5 +++++ 2 files changed, 27 insertions(+) diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index 0d1dd5601f..da42435c13 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -145,6 +145,15 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base $this->addTask('Add Index to financial_trxn trxn_id field', 'addIndexFinancialTrxnTrxnID'); } + /** + * Upgrade function. + * + * @param string $rev + */ + public function upgrade_4_7_1($rev) { + $this->addTask('Add Index to civicrm_contribution creditnote_id field', 'addIndexContributionCreditNoteID'); + } + /** * CRM-16354 * @@ -405,4 +414,17 @@ FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id"; return TRUE; } + /** + * CRM-17882 Add index to civicrm_contribution.credit_note_id. + * + * @param \CRM_Queue_TaskContext $ctx + * + * @return bool + */ + public function addIndexContributionCreditNoteID(CRM_Queue_TaskContext $ctx) { + $tables = array('civicrm_contribution' => array('creditnote_id')); + CRM_Core_BAO_SchemaHandler::createIndexes($tables); + return TRUE; + } + } diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index db883c14e6..ea95a36ab7 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -464,6 +464,11 @@ Text + + creditnote_id + creditnote_id + 4.7 + tax_amount Tax Amount -- 2.25.1