-
-
Notifications
You must be signed in to change notification settings - Fork 827
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-20313,CRM-19357: Add index to civicrm_activity.status_id and unique index to civicrm_entity_financial_account table #10056
Conversation
Edzelopez
commented
Mar 27, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-20313: Add index to civicrm_activity.status_id
- CRM-19357: Add unique constraint on civicrm_entity_financial_account
jenkin test this please |
Is this okay to merge? |
Tested on upgrade and install. The PR works for me. @colemanw @eileenmcnaughton can you please merge this PR if the final patch looks good to you. |
$tables = array('civicrm_activity' => array('status_id')); | ||
CRM_Core_BAO_SchemaHandler::createIndexes($tables); | ||
return TRUE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should be a generic function following the same pattern as \CRM_Upgrade_Incremental_Base::addColumn()
and \CRM_Upgrade_Incremental_Base::dropColumn
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw we've been recommending that function. I guess it could be moved to another class - but there are non-upgraded reasons to add & drop indexes.
My reservation about this & the 2 other open PRs for adding indexes is that on large sites adding indexes to large tables can be very slow and I feel like we should complete the work @aydun started to allow indexes to be declared & sites to reconcile them, rather than forcing them to either not upgrade to the next point version or have a significant outage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not saying don't use the CRM_Core_BAO_SchemaHandler::createIndexes
function. I'm saying wrap it in a generic function in CRM_Upgrade_Incremental_Base
instead of wrapping it in this one-off function.
a12253e
to
1136146
Compare
Jenkin test this please |
@colemanw I have made the changes like you suggested, can you merge it? |
1136146
to
d2699ac
Compare
Note that if we merge this we should also merge the other PRs for adding indexes if 4.7.19 is going to be painful for large sites we should consolidate the pain |
3a6abbd
to
e9b4845
Compare
@eileenmcnaughton I have included the #10023 changes in this PR as it was dependent on this patch. Is there any other PR which adds index in 4.7.19 ? Bdw test build is failing for each PR at the moment |
Jenkin test this please |
I'm happy to merge the schema changes & changes for new installs. I would prefer to use a better approach for adding this & other schema changes via update - @aydun has done 95% of the work & #10109 has all except a small piece ready to go in. Shall we get the DAO & schema changes merged & the new install sql for this & the other indexes & then worry about how to add them to existing installs in a non-damaging way? |
@monishdeb I merged #10131 can you please remove the similar code from here? |
@colemanw @JoeMurray I am removing the upgrade code as suggested by Eileen here. Will check what the best way to handle these indexes in upgrade after #10109 gets merged. |
143fde6
to
d3d5cfd
Compare
The test failures are related - likely either something wrong with the test or this has revealed an actual bug |
9332a3f
to
eaca7bc
Compare
eaca7bc
to
c0fc66a
Compare
@eileenmcnaughton the test build passed. Please have a look at the final patch |
@monishdeb so 2 things here ...
Note it would be ideal to add these indexes before running the mysql |
Looks like the sql doesn't get committed - so that part is moot. We probably still should change that index name. Looks like 64 is the max http://stackoverflow.com/questions/16920001/maximum-length-of-a-column-name-in-mysql and I don't think we are there |
@eileenmcnaughton I have changed the index name and then included the |
…ue index to civicrm_entity_financial_account table
485da96
to
d9155f3
Compare
closed in favour of #10169 |