Upgraded from 4.6.19 to 4.7.27 (on wordpress 4.8.3) and attempted to update indices. The table that fails is civicrm_case_contact, with the old index UI_case_contact_id. The error is identical to that reported in this question https://stackoverflow.com/questions/1451042/mysql-error-when-dropping-index-errno-150 There are a number of possibilities listed in the answers to that, but I'm a SQL newbie and the data structures should be familiar to developers following this forum. Any ideas on what's the likeliest cause?
In our application we have not encountered cases and the table is empty. Would it be best to disable CiviCase and delete relevant tables? Or is that asking for more trouble?

  • I can see there's a uniqueness added to the index in 4.7 over 4.6 (compare xml/schema/CaseContact.xml), but I can't see where the actual drop/recreate happens. Assuming the rest of the install is ok what you could do is install a test fresh 4.7 separately and then compare the output of SHOW CREATE TABLE civicrm_case_contact and manually adjust. But the error happens because of the foreign keys on the table, so you'd need to drop those first, then re-add them.
    – Demerit
    Commented Nov 24, 2017 at 16:25
  • 1
    Thanks for the comment. I have looked at this question civicrm.stackexchange.com/questions/18739/… and it appears to be a known issue of some kind. WIth my limited db experience I'm tempted to bypass this particular table index fixup and proceed to the few others that need updating. Does that sound possible?
    – PhilF
    Commented Nov 24, 2017 at 16:37
  • Yes I'd agree that post seems like the same problem.
    – Demerit
    Commented Nov 24, 2017 at 18:23
  • 1
    Possible duplicate of Problem fixing missing indexes after upgrade to 4.7
    – Alan Dixon
    Commented Nov 28, 2017 at 18:51
  • Possible duplicate of How to find and/or fix missing indices? Commented Nov 28, 2017 at 19:32


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.