When I run
cv ev 'print_r(CRM_Core_BAO_SchemaHandler::getMissingIndices())'
I get the following output:
Array
(
[civicrm_case_contact] => Array
(
[0] => Array
(
[name] => UI_case_contact_id
[field] => Array
(
[0] => case_id
[1] => contact_id
)
[localizable] =>
[unique] => 1
[sig] => civicrm_case_contact::1::case_id::contact_id
)
)
)
If I then go into db and try to delete the index in order to fix it I get an error:
mysql> alter table civicrm_case_contact drop index UI_case_contact_id;
ERROR 1553 (HY000): Cannot drop index 'UI_case_contact_id': needed in a foreign key constraint
Looking at the table, it appears the index is fine:
civicrm_case_contact | CREATE TABLE `civicrm_case_contact` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique case-contact association id',
`case_id` int(10) unsigned NOT NULL COMMENT 'Case ID of case-contact association.',
`contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of contact record given case belongs to.',
PRIMARY KEY (`id`),
KEY `UI_case_contact_id` (`case_id`,`contact_id`),
KEY `FK_civicrm_case_contact_contact_id` (`contact_id`),
CONSTRAINT `FK_civicrm_case_contact_case_id` FOREIGN KEY (`case_id`) REFERENCES `civicrm_case` (`id`) ON DELETE CASCADE,
CONSTRAINT `FK_civicrm_case_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
What's required to fix this index or otherwise deal with the error message?