Add redundant contact_id field for search kit/form builder; add index on category field...

This commit is contained in:
Rich Lott / Artful Robot 2024-02-28 17:18:46 +00:00
parent 9fee48603b
commit 7b611c343f
7 changed files with 113 additions and 29 deletions

View file

@ -54,13 +54,13 @@ class Sync extends \Civi\Api4\Generic\AbstractAction {
Civi::log()->debug('', ['=' => 'pop']);
}
Civi::log()->debug('Resetting table', ['=' => 'timed']);
Civi::log()->debug('Resetting table', ['=' => 'start,timed']);
// clear out temp space.
CRM_Core_DAO::executeQuery("UPDATE civicrm_contact_category SET next_category = 0;")->free();
// ensure we have all our contacts covered.
CRM_Core_DAO::executeQuery(<<<SQL
INSERT IGNORE INTO civicrm_contact_category
SELECT id, 0 as category, 0 next_category
SELECT id, id contact_id, 0 as category, 0 next_category
FROM civicrm_contact
SQL)->free();
Civi::log()->debug('', ['=' => 'pop']);