From e2c547a9cdfedb090022da1623423c6d10f98005 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 3 Sep 2019 19:23:13 +1200 Subject: [PATCH] Add index to civicrm_contact.created_date & modified_date 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) --- CRM/Contact/DAO/Contact.php | 18 +++++++++++++++++- xml/schema/Contact/Contact.xml | 10 ++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index 5bc2b38a3b2a..dd156d7e62f2 100644 --- a/CRM/Contact/DAO/Contact.php +++ b/CRM/Contact/DAO/Contact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Contact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:bd37bd31a0ac8ba4fd5f411fddef080b) + * (GenCodeChecksum:f9efaf58b308bdcab56a0d5f9e76524f) */ /** @@ -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; } diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 1539d0c6e8b3..6d11a52aa222 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -874,6 +874,11 @@ NULL 4.3 + + index_created_date + created_date + 5.18 + modified_date timestamp @@ -883,4 +888,9 @@ CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 4.3 + + index_modified_date + modified_date + 5.18 +