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

Fix default value of civicrm_option_group.is_locked in DB schema #12862

Merged
merged 1 commit into from
Sep 24, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

Overview
The 5.5 update set civicrm_option_group.is_locked & is_reserved to have a db defaults but the upgrade script was incorrect on is_locked

Before
Newly created option groups (e.g for custom fields) are set to is_locked

After
Newly created option groups (e.g for custom fields) are not set to is_locked

Technical Details
The default for new instals was correct

Comments
@seamuslee001

@colemanw colemanw merged commit f89bb87 into civicrm:5.5 Sep 24, 2018
@eileenmcnaughton eileenmcnaughton deleted the locked55 branch September 24, 2018 20:34
@totten totten changed the title Fix typo in 5.5 upgrade script Fix default value of is_locked in DB schema Sep 25, 2018
@totten
Copy link
Member

totten commented Sep 25, 2018

Thinking about how this gets cleaned up on sites. We could document a procedure for using SQL to inspect the option-groups and update is_locked on a handful?

Or what about adding this query to the upgrade script:

UPDATE civicrm_option_group SET is_locked = 1 WHERE name regexp '.*_2018[0-9]+$';

To wit: for any option-groups which look like user-generated ones from 2018 (b/c it ends with _2019nnnnnnnn), switch off the lock. It's not perfect... we could concoct a scenario where this cleanup flubs something. But it seems like a decent default behavior. Open to better ideas.

@totten totten changed the title Fix default value of is_locked in DB schema Fix default value of civicrm_option_group.is_locked in DB schema Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants