Answers.Body: <p>You'll have to work on your database directly. The following works for me - although the Status screen still shows the error until the Update Indices button is clicked again after the repair has been done (I presume it simply verifies the fix):</p>
  
  <pre><code>USE your_civicrm_db;
  SHOW CREATE TABLE civicrm_case_contact;
  SET foreign_key_checks = 0;
  DROP INDEX `UI_case_contact_id` on civicrm_case_contact;
  CREATE UNIQUE INDEX `UI_case_contact_id` ON civicrm_case_contact (case_id, contact_id);
  SET foreign_key_checks = 1;
  </code></pre>
  
  <p>If you do this via PhpMyAdmin (or similar), you can skip <code>USE your_civicrm_db;</code> since you'll have already navigated there.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-12T12:14:54.290Z
Answers.Text: Hi - on behalf of the OP - this is not working for us. We still encounter the "dop index ui_case_contact_id on civicrm_case_contact cannot drop index ui_case_contact_id needed in a foreign key constraint". This is after running the commands exactly as above including set foreign_key_checks=0;
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-12T12:15:03.570Z
Answers.Text: Also, missing you at the sprint!
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-12T12:58:07.093Z
Answers.Text: @JohnFF To state the obvious, it sounds like `foreign_key_checks` isn't being set to `0`. I've no idea why that should be the case for you. [OT: Hope the sprint is fun and that someone's brought a hacky sack; it's just the weather for it!]
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-23T16:03:34.600Z
Answers.Text: Thanks for the suggestion Christian. When I run this I get the following error: **Error
  
  SQL query:
  
  DROP INDEX `UI_case_contact_id` on civicrm_case_contact
  
  MySQL said: Documentation
  #1553 - Cannot drop index 'UI_case_contact_id': needed in a foreign key constraint**
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T17:02:33.520Z
Answers.Text: Could this have something to do with not having CiviCase enabled?
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-03T11:20:58.223Z
Answers.Text: This type of error is still there in civicrm 4.7.29.
Answers.UserDisplayName: Paul Kleingeld
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-12T10:00:24.877Z
Answers.LastActivityDate: 2017-10-12T10:00:24.877Z
Answers.UserDisplayName: Christian Wach
Body: <p>This is related to a question I posted yesterday (<a href="https://civicrm.stackexchange.com/questions/20725/how-does-one-delete-key-indices">How does one delete &quot;key indices&quot;?</a>), which was considered a duplicate of another question (<a href="https://civicrm.stackexchange.com/questions/20236/performance-warning-missing-indices-mismatched-index-key">Performance Warning: Missing Indices. Mismatched Index Key</a>). I am posting this new question because it seems to be a somewhat different issue and because adding a comment to one of those other posts didn't quite seem to fit with this.</p>
  
  <p>It was suggested that installing 4.7.25 would resolve that issue. However, it seems to have produced a new one. </p>
  
  <p>With 4.7.25 installed under Drupal 7, I now get this warning:</p>
  
  <blockquote>
    <p>Performance warning: Missing indices</p>
    
    <p>The following tables have missing indices. Click 'Update Indices'
    button to create them.</p>
    
    <p>Table Name    Key Name    Expected Indices
    civicrm_option_value  index_option_group_id_name  name(128),
    option_group_id civicrm_case_contact  UI_case_contact_id  case_id,
    contact_id</p>
  </blockquote>
  
  <p>But when I click the Update Indices button, I get this error:</p>
  
  <blockquote>
    <p>Operation failed: Update Indices DB Error: unknown error Debug
    information: DROP INDEX index_option_group_id_name ON
    civicrm_option_value [nativecode=1553 ** Cannot drop index
    'index_option_group_id_name': needed in a foreign key constraint]</p>
  </blockquote>
  
  <p>Any help on what I can do about this would be appreciated. Please spell it out for me though; I'm not an expert at this stuff. Thanks.</p>
  
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-11T08:50:40.453Z
Comments.Text: Same problem for me on WP civicrm 4.7.25 installation.
Comments.UserDisplayName: Frank
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-07T16:46:22.313Z
Comments.Text: I am still getting this after upgrade to 4.7.27. Help please.
Comments.UserDisplayName: The Amateur
Tags: <error><4.7><indices>
Title: What to do about "Operation failed: Update Indices DB Error: unknown error Debug" after upgrading to 4.7.25
ThreadText: # What to do about "Operation failed: Update Indices DB Error: unknown error Debug" after upgrading to 4.7.25
  
  (Asked by: username_0 on 2017-10-04)
  
  This is related to a question I posted yesterday ([How does one delete "key indices"?](https://civicrm.stackexchange.com/questions/20725/how-does-one-delete-key-indices)), which was considered a duplicate of another question ([Performance Warning: Missing Indices. Mismatched Index Key](https://civicrm.stackexchange.com/questions/20236/performance-warning-missing-indices-mismatched-index-key)). I am posting this new question because it seems to be a somewhat different issue and because adding a comment to one of those other posts didn't quite seem to fit with this.
  
  It was suggested that installing 4.7.25 would resolve that issue. However, it seems to have produced a new one.
  
  With 4.7.25 installed under Drupal 7, I now get this warning:
  
  > Performance warning: Missing indices
  >
  > The following tables have missing indices. Click 'Update Indices'
  > button to create them.
  >
  > Table Name Key Name Expected Indices
  > civicrm\_option\_value index\_option\_group\_id\_name name(128),
  > option\_group\_id civicrm\_case\_contact UI\_case\_contact\_id case\_id,
  > contact\_id
  
  But when I click the Update Indices button, I get this error:
  
  > Operation failed: Update Indices DB Error: unknown error Debug
  > information: DROP INDEX index\_option\_group\_id\_name ON
  > civicrm\_option\_value [nativecode=1553 \*\* Cannot drop index
  > 'index\_option\_group\_id\_name': needed in a foreign key constraint]
  
  Any help on what I can do about this would be appreciated. Please spell it out for me though; I'm not an expert at this stuff. Thanks.
  
  Thanks.
  
  **Tags:** error, 4.7, indices
  
  > **Comments:**
  > **username_1**: Same problem for me on WP civicrm 4.7.25 installation.  
  > **username_0**: I am still getting this after upgrade to 4.7.27. Help please.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-10-12. Score: 3 | Accepted answer
  
  You'll have to work on your database directly. The following works for me - although the Status screen still shows the error until the Update Indices button is clicked again after the repair has been done (I presume it simply verifies the fix):
  USE your_civicrm_db;
  SHOW CREATE TABLE civicrm_case_contact;
  SET foreign_key_checks = 0;
  DROP INDEX `UI_case_contact_id` on civicrm_case_contact;
  CREATE UNIQUE INDEX `UI_case_contact_id` ON civicrm_case_contact (case_id, contact_id);
  SET foreign_key_checks = 1;
  
  If you do this via PhpMyAdmin (or similar), you can skip USE your_civicrm_db; since you'll have already navigated there.
  
  > **Comments:**
  > **username_3**: Hi - on behalf of the OP - this is not working for us. We still encounter the "dop index ui_case_contact_id on civicrm_case_contact cannot drop index ui_case_contact_id needed in a foreign key constraint". This is after running the commands exactly as above including set foreign_key_checks=0;  
  > **username_3**: Also, missing you at the sprint!  
  > **username_2**: @username_3 To state the obvious, it sounds like `foreign_key_checks` isn't being set to `0`. I've no idea why that should be the case for you. [OT: Hope the sprint is fun and that someone's brought a hacky sack; it's just the weather for it!]  
  > **username_0**: Thanks for the suggestion Christian. When I run this I get the following error: **Error  SQL query:  DROP INDEX `UI_case_contact_id` on civicrm_case_contact  MySQL said: Documentation #1553 - Cannot drop index 'UI_case_contact_id': needed in a foreign key constraint**  
  > **username_0**: Could this have something to do with not having CiviCase enabled?  
  > **username_4**: This type of error is still there in civicrm 4.7.29.  
  
  ---
  
  