Merge pull request #19435 from civicrm/5.34
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 4.6.9.mysql.tpl
CommitLineData
d62d8911 1{* file to handle db changes in 4.6.9 during upgrade *}
31df7c17 2
3-- CRM-17112 - Add Missing countries Saint Barthélemy and Saint Martin
4INSERT INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("Saint Barthélemy", "BL", "2", "0");
5INSERT INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("Saint Martin (French part)", "MF", "2", "0");
26c86e30
GC
6
7-- CRM-17039 - Add credit note for cancelled payments
f8bb273f 8{include file='../CRM/Upgrade/4.6.9.msg_template/civicrm_msg_template.tpl'}
9
10-- CRM-17258 - Add created id, owner_id to report instances.
11ALTER TABLE civicrm_report_instance
12ADD COLUMN `created_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to contact table.',
13ADD COLUMN `owner_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to contact table.',
14ADD CONSTRAINT `FK_civicrm_report_instance_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL,
15ADD CONSTRAINT `FK_civicrm_report_instance_owner_id` FOREIGN KEY (`owner_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL;
1f99b601
CW
16
17-- CRM-16907
18SELECT @navMaxWeight := MAX(ROUND(weight)) from civicrm_navigation WHERE parent_id IS NULL;
19
20-- Add "support" menu if it's not there already
21INSERT INTO civicrm_navigation (domain_id, label, name, is_active, weight)
22SELECT * FROM (SELECT {$domainID} as domain_id, 'Support' as label, 'Help' as name, 1 as is_active, @navMaxWeight + 1 as weight) AS tmp
23WHERE NOT EXISTS (
24SELECT name FROM civicrm_navigation WHERE name = 'Help' AND domain_id = {$domainID}
25) LIMIT 1;
26
27SELECT @adminHelplastID := id FROM civicrm_navigation WHERE name = 'Help' AND domain_id = {$domainID};
28
29UPDATE civicrm_navigation
30SET name = 'Support', label = '{ts escape="sql" skip="true"}Support{/ts}'
31WHERE id = @adminHelplastID;
32
b5d8cdd7 33DELETE FROM civicrm_navigation where parent_id = @adminHelplastID AND (name = 'Developer' OR url LIKE "http://civicrm.org%");
1f99b601
CW
34
35INSERT INTO civicrm_navigation
36( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight )
37VALUES
5d1cf4e2
CW
38( {$domainID}, 'https://civicrm.org/get-started?src=iam', '{ts escape="sql" skip="true"}Get started{/ts}', 'Get started', NULL, 'AND', @adminHelplastID, '1', NULL, 1 ),
39( {$domainID}, 'https://civicrm.org/documentation?src=iam', '{ts escape="sql" skip="true"}Documentation{/ts}', 'Documentation', NULL, 'AND', @adminHelplastID, '1', NULL, 2 ),
40( {$domainID}, 'https://civicrm.org/ask-a-question?src=iam', '{ts escape="sql" skip="true"}Ask a question{/ts}', 'Ask a question', NULL, 'AND', @adminHelplastID, '1', NULL, 3 ),
41( {$domainID}, 'https://civicrm.org/experts?src=iam', '{ts escape="sql" skip="true"}Get expert help{/ts}', 'Get expert help', NULL, 'AND', @adminHelplastID, '1', NULL, 4 ),
42( {$domainID}, 'https://civicrm.org/about?src=iam', '{ts escape="sql" skip="true"}About CiviCRM{/ts}', 'About CiviCRM', NULL, 'AND', @adminHelplastID, '1', 1, 5 ),
43( {$domainID}, 'https://civicrm.org/register-your-site?src=iam&sid={ldelim}sid{rdelim}', '{ts escape="sql" skip="true"}Register your site{/ts}', 'Register your site', NULL, 'AND', @adminHelplastID, '1', NULL, 6 ),
44( {$domainID}, 'https://civicrm.org/become-a-member?src=iam&sid={ldelim}sid{rdelim}', '{ts escape="sql" skip="true"}Join CiviCRM{/ts}', 'Join CiviCRM', NULL, 'AND', @adminHelplastID, '1', NULL, 7 );
1f99b601
CW
45
46INSERT INTO civicrm_navigation
47( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight )
48VALUES
49( {$domainID}, NULL, '{ts escape="sql" skip="true"}Developer{/ts}', 'Developer', 'administer CiviCRM', '', @adminHelplastID, '1', 1, 8 );
50
51SET @devellastID:=LAST_INSERT_ID();
52INSERT INTO civicrm_navigation
53( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight )
54VALUES
55( {$domainID}, 'civicrm/api', '{ts escape="sql" skip="true"}API Explorer{/ts}','API Explorer', 'administer CiviCRM', '', @devellastID, '1', NULL, 1 ),
5d1cf4e2
CW
56( {$domainID}, 'https://civicrm.org/developer-documentation?src=iam', '{ts escape="sql" skip="true"}Developer Docs{/ts}', 'Developer Docs', 'administer CiviCRM', '', @devellastID, '1', NULL, 3 );
57
58-- Set CiviCRM URLs to https
59UPDATE civicrm_navigation SET url = REPLACE(url, 'http://civicrm.org', 'https://civicrm.org');