From 12d14e6448007a6b1d25d690d672462c5b1bedbc Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Fri, 20 Feb 2015 17:42:26 -0800 Subject: [PATCH] CRM-14578 - Add upgrade logic and incorporate FK fix for location_type_id ---------------------------------------- * CRM-14578: Relocate Advanced Date Input Settings to Customize data and screens menu https://issues.civicrm.org/jira/browse/CRM-14578 --- CRM/Upgrade/Incremental/sql/4.6.beta1.mysql.tpl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CRM/Upgrade/Incremental/sql/4.6.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.6.beta1.mysql.tpl index ed9505bfc4..9ba5f49f4b 100644 --- a/CRM/Upgrade/Incremental/sql/4.6.beta1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.6.beta1.mysql.tpl @@ -1,4 +1,15 @@ {* file to handle db changes in 4.6.beta1 during upgrade *} -- See https://issues.civicrm.org/jira/browse/CRM-15361 +UPDATE civicrm_mailing SET location_type_id = NULL WHERE location_type_id = 0; ALTER TABLE civicrm_mailing ADD CONSTRAINT FK_civicrm_mailing_location_type_id FOREIGN KEY FK_civicrm_mailing_location_type_id(`location_type_id`) REFERENCES `civicrm_location_type`(`id`) ON DELETE SET NULL; +SELECT @parent_id := id from `civicrm_navigation` where name = 'Customize Data and Screens' AND domain_id = {$domainID}; +SELECT @add_weight_id := weight from `civicrm_navigation` where `name` = 'Search Preferences' and `parent_id` = @parent_id; +UPDATE `civicrm_navigation` +SET `weight` = `weight`+1 +WHERE `parent_id` = @parent_id +AND `weight` > @add_weight_id; +INSERT INTO `civicrm_navigation` +( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) +VALUES +( {$domainID}, 'civicrm/admin/setting/preferences/date?reset=1', '{ts escape="sql" skip="true"}Date Preferences{/ts}', 'Date Preferences', 'administer CiviCRM', '', @parent_id , '1', NULL, @add_weight_id + 1 ); -- 2.25.1