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

Foreign key for civicrm_custom_field.option_group_id #12706

Merged
merged 2 commits into from
Aug 29, 2018

Conversation

pradpnayak
Copy link
Contributor

@pradpnayak pradpnayak commented Aug 21, 2018

Overview

This PR added Foreign key for civicrm_custom_field.option_group_id

@civibot
Copy link

civibot bot commented Aug 21, 2018

(Standard links)

<name>option_group_id</name>
<table>civicrm_option_group</table>
<key>id</key>
<add>5.3</add>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.6

@colemanw
Copy link
Member

Makes sense to me. If tests pass I think we're good to go.
@pradpnayak would you please fix the version?

@pradpnayak
Copy link
Contributor Author

@colemanw do we need to add upgrade code for this? or is this something done automatically by running updateindices after upgrade?

@pradpnayak
Copy link
Contributor Author

@colemanw I have updated the version to 5.6. Can you please review now?

@pradpnayak pradpnayak changed the title Foreign key for civicrm_option_group.option_group_id Foreign key for civicrm_option_value.option_group_id Aug 24, 2018
@pradpnayak pradpnayak changed the title Foreign key for civicrm_option_value.option_group_id Foreign key for civicrm_custom_field.option_group_id Aug 24, 2018
@eileenmcnaughton
Copy link
Contributor

hopefully if people run update indices it will work - be good if you cold test that though

@colemanw
Copy link
Member

I can't seem to make it work. My steps:

  • Checkout 5.5 + this PR
  • Observe that there is one index on the civicrm_custom_field table (FK_civicrm_custom_field_custom_group_id)
  • Run upgrade script
  • Can't see any new indexes
  • Visit the system status page. Expect to see a missing index warning, but there is none.

@eileenmcnaughton
Copy link
Contributor

@colemanw indexes are added by running the api System.updateindices I think

@eileenmcnaughton
Copy link
Contributor

(we don't 'impose' index changes as they can make the upgrade process painful so we have a job - it was advertised via a system check but someone turned it off as some old sites had some issues)

@colemanw
Copy link
Member

Ok I typed CRM.api3('System', 'updateindexes') into the browser console and it returned a success state, but the index still doesn't exist in my db :(

@eileenmcnaughton
Copy link
Contributor

oh - well this will update it for new installs so I'm Ok with us merging it - at some point some more work needs to be done on the updateindexes. We were working on it but then the check was removed & momentum died. Perhaps the UK sprint though

@colemanw colemanw merged commit 72ea63d into civicrm:master Aug 29, 2018
@pradpnayak pradpnayak deleted the OptionGroupFK branch September 17, 2018 09:59
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.

4 participants