Skip to content

Commit

Permalink
Add index to civicrm_contact.created_date & modified_date
Browse files Browse the repository at this point in the history
Note this will add the indexes to new installs or to installs who run the script to update indexes
(we used to promote this via a status check but there was a bug & we 'hushed' it & stopped trying to fix
the bug)
  • Loading branch information
eileenmcnaughton committed Sep 3, 2019
1 parent 2c55712 commit e2c547a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
18 changes: 17 additions & 1 deletion CRM/Contact/DAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contact/Contact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:bd37bd31a0ac8ba4fd5f411fddef080b)
* (GenCodeChecksum:f9efaf58b308bdcab56a0d5f9e76524f)
*/

/**
Expand Down Expand Up @@ -1589,6 +1589,22 @@ public static function indices($localize = TRUE) {
'localizable' => FALSE,
'sig' => 'civicrm_contact::0::is_deleted::sort_name::id',
],
'index_created_date' => [
'name' => 'index_created_date',
'field' => [
0 => 'created_date',
],
'localizable' => FALSE,
'sig' => 'civicrm_contact::0::created_date',
],
'index_modified_date' => [
'name' => 'index_modified_date',
'field' => [
0 => 'modified_date',
],
'localizable' => FALSE,
'sig' => 'civicrm_contact::0::modified_date',
],
];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
}
Expand Down
10 changes: 10 additions & 0 deletions xml/schema/Contact/Contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,11 @@
<default>NULL</default>
<add>4.3</add>
</field>
<index>
<name>index_created_date</name>
<fieldName>created_date</fieldName>
<add>5.18</add>
</index>
<field>
<name>modified_date</name>
<type>timestamp</type>
Expand All @@ -883,4 +888,9 @@
<default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
<add>4.3</add>
</field>
<index>
<name>index_modified_date</name>
<fieldName>modified_date</fieldName>
<add>5.18</add>
</index>
</table>

0 comments on commit e2c547a

Please sign in to comment.