CRM-17999 add index to civicrm_contribution.contribution_source
authoreileen <emcnaughton@wikimedia.org>
Tue, 9 Feb 2016 00:50:28 +0000 (13:50 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 9 Feb 2016 20:49:56 +0000 (09:49 +1300)
Change-Id: Ia187634fa7b58c63a365f652894e7f3bb298ec35

CRM/Upgrade/Incremental/php/FourSeven.php
xml/schema/Contribute/Contribution.xml

index 7d6a32749b4104a2e61d39b302c64effb1c0d797..5ea8cbab8d6a7353556383e98b7c7289762cbd6c 100644 (file)
@@ -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;
+  }
+
 }
index 614db5b34094a8bdffca65673df7dfb9fdc8cf9e..0e84514dec4dbf0d417d9cb56db37683e028d4b8 100644 (file)
       <type>Text</type>
     </html>
   </field>
+  <index>
+    <name>index_source</name>
+    <fieldName>source</fieldName>
+    <add>4.7</add>
+  </index>
   <field>
     <name>amount_level</name>
     <title>Amount Label</title>