Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20533 - Drop false indices directly from update indices button #10908

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

jitendrapurohit
Copy link
Contributor

@jitendrapurohit jitendrapurohit commented Aug 28, 2017

Overview

Delete false indices while updating missing indices button along with displaying it on system status page.

Before

  • Indices get displayed on s/m status page and tell users to delete them manually.
  • Inconsistency in getMissingIndices function which return missing + false indices.

After

  • False indices get directly deleted from Update Indices button instead of asking users to do so.
  • Introduce $dropFalseIndices param in getMissingIndices() which deletes false indices to ensure all indexes returned from this function is not present in civi tables.
  • Handle unit test accordingly.
  • Fix system status display message and list all missing indices to provide extra information along with Update Indices button.

Technical Details

The actual issue here was - on 4.7 upgrade some existing indices were deleted. Note that: there is no issue on complete deletion of these indices. But issue arises only when one of the column in the key index is removed or the order of the column mismatches the definition provided in the xml file.

This PR makes sure to delete non-FK indices from the table. Not sure, but I haven't come across the situation where FK index has a missing column. To all the sites I upgraded, there always was the case where normal indexes were unordered or missing some of the column names.

Hence, dropping FK like https://github.com/civicrm/civicrm-core/pull/10414/files#diff-857aa2763691dd851a1423506a99ad65R775 seems non-essential. Also, I recall retrieving details from information_schema has bitten us in the past. Eg. CRM-19610?


@eileenmcnaughton
Copy link
Contributor

I don't love the idea that a function called getMissingIndices can drop them - but I can live with it.

Just need someone to test.

@eileenmcnaughton
Copy link
Contributor

I'm going to merge this so it hits the rc as this has been affecting multiple people. Will tell people on stackexchange to try the rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants