Skip to content

Commit

Permalink
Added upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
pradpnayak committed Jul 18, 2018
1 parent eaf8742 commit 431343f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CRM/Upgrade/Incremental/sql/5.5.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@ UPDATE civicrm_option_group AS cog INNER JOIN civicrm_custom_field AS ccf
ON cog.id = ccf.option_group_id
SET cog.is_reserved = 0 WHERE cog.is_active = 1 AND ccf.is_active = 1;
UPDATE civicrm_option_group SET is_reserved = 1 WHERE name='environment';

#https://lab.civicrm.org/dev/financial/issues/29
SELECT @option_group_id_cgeo := max(id) FROM civicrm_option_group
WHERE name = 'cg_extend_objects';

SELECT @option_group_id_ceo_wt := MAX(weight) FROM civicrm_option_value
WHERE option_group_id = @option_group_id_cgeo;

INSERT INTO
civicrm_option_value(`option_group_id`, {localize field='label'}`label`{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}`description`{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `domain_id`, `visibility_id`)
VALUES
(@option_group_id_cgeo, {localize field='label'}'{ts escape="sql"}Financial Type{/ts}'{/localize}, 'FinancialType', 'civicrm_financial_type', NULL, 0, NULL, @option_group_id_ceo_wt+1, {localize field='description'}NULL{/localize}, 0, 0, 1, NULL, NULL, NULL);

0 comments on commit 431343f

Please sign in to comment.