$requiredSigs = $existingSigs = array();
// Get the indices defined (originally) in the xml files
$requiredIndices = CRM_Core_DAO_AllCoreTables::indices();
+ $reqSigs = array();
foreach ($requiredIndices as $table => $indices) {
$reqSigs[] = CRM_Utils_Array::collect('sig', $indices);
}
// Get the indices in the database
$existingIndices = CRM_Core_BAO_SchemaHandler::getIndexes(array_keys($requiredIndices));
+ $extSigs = array();
foreach ($existingIndices as $table => $indices) {
CRM_Core_BAO_SchemaHandler::addIndexSignature($table, $indices);
$extSigs[] = CRM_Utils_Array::collect('sig', $indices);
$missingIndices = array();
foreach ($missingSigs as $sig) {
$sigParts = explode('::', $sig);
- foreach ($requiredIndices[$sigParts[0]] as $index) {
- if ($index['sig'] == $sig) {
- $missingIndices[$sigParts[0]][] = $index;
- continue;
+ if (array_key_exists($sigParts[0], $requiredIndices)) {
+ foreach ($requiredIndices[$sigParts[0]] as $index) {
+ if ($index['sig'] == $sig) {
+ $missingIndices[$sigParts[0]][] = $index;
+ continue;
+ }
}
}
}