Merge pull request #4054 from eileenmcnaughton/CRM-15237
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 3.4.6.mysql.tpl
CommitLineData
6a488035
TO
1-- CRM-8483
2{include file='../CRM/Upgrade/3.4.6.msg_template/civicrm_msg_template.tpl'}
3
4-- CRM-8619
5
6SELECT @option_group_id_languages := MAX( id ) FROM civicrm_option_group WHERE name = 'languages';
7
8DELETE FROM civicrm_option_value WHERE option_group_id = @option_group_id_languages AND name = 'de_CH';
9DELETE FROM civicrm_option_value WHERE option_group_id = @option_group_id_languages AND name = 'es_PR';
10
11SELECT @languages_max_weight := MAX( weight ) FROM civicrm_option_value WHERE option_group_id = @option_group_id_languages;
12
13INSERT INTO civicrm_option_value
14 (option_group_id, is_default, is_active, name, value, {localize field='label'}label{/localize}, weight)
15VALUES
16(@option_group_id_languages, 0, 1, 'de_CH', 'de', {localize}'{ts escape="sql"}German (Swiss){/ts}'{/localize}, @weight := @languages_max_weight + 1),
17(@option_group_id_languages, 0, 1, 'es_PR', 'es', {localize}'{ts escape="sql"}Spanish; Castilian (Puerto Rico){/ts}'{/localize}, @weight := @languages_max_weight + 2);
18
19-- CRM-8653
20UPDATE civicrm_dashboard SET url = 'civicrm/report/instance/3&reset=1&section=2&snippet=4&context=dashlet' WHERE url = 'civicrm/report/instance/3&reset=1&section=2&snippet=4';
21
22-- CRM-8654
23ALTER TABLE `civicrm_dashboard_contact` CHANGE `content` `content` LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'dashlet content';
24
25-- CRM-8664
26SELECT @ogrID := max(id) from civicrm_option_group where name = 'report_template';
27SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute';
28SELECT @max_weight := MAX(ROUND(weight)) from civicrm_option_value WHERE option_group_id = @ogrID;
29INSERT INTO civicrm_option_value
10824d34 30 (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, visibility_id )
6a488035
TO
31VALUES
32 (@ogrID , {localize}'{ts escape="sql"}Contribution History By Relationship Report{/ts}'{/localize}, 'contribute/history', 'CRM_Report_Form_Contribute_History', NULL, 0, 0, @max_weight+1, {localize}'{ts escape="sql"}List contact\'s donation history, grouped by year, along with contributions attributed to any of the contact\'s related contacts.{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL);
33
34-- CRM-8728
35SELECT @option_group_id_activity_type := max(id) from civicrm_option_group where name = 'activity_type';
36{if $bulkEmailActivityType}
37 -- make sure Bulk Email is active and resereved
38 UPDATE civicrm_option_value SET is_reserved = 1, is_active = 1 WHERE option_group_id=@option_group_id_activity_type AND name='Bulk Email';
39{else}
40 -- insert activity type Bulk Email
41 SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @option_group_id_activity_type;
42 SELECT @max_wt := max(weight) from civicrm_option_value where option_group_id=@option_group_id_activity_type;
43 INSERT INTO civicrm_option_value
44 (option_group_id, {localize field='label'}label{/localize}, {localize field='description'}description{/localize}, value, name, weight, filter, is_reserved, component_id)
45 VALUES
46 (@option_group_id_activity_type, {localize}'Bulk Email'{/localize}, {localize}'Bulk Email Sent.'{/localize}, (@max_val+1), 'Bulk Email', (SELECT @max_wt := @max_wt+1), 1, 1, NULL);
47{/if}
48
49-- CRM-8859
50ALTER TABLE `civicrm_prevnext_cache`
51 ADD INDEX index_all ( cacheKey, entity_id1, entity_id2, entity_table );
52
53-- CRM-8483
54
55ALTER TABLE `civicrm_price_set`
56 ADD `contribution_type_id` int(10) unsigned default NULL COMMENT 'Conditional foreign key to civicrm_contribution_type.id.',
57 ADD CONSTRAINT `FK_civicrm_price_set_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`) ON DELETE SET NULL;
10824d34 58
6a488035
TO
59ALTER TABLE `civicrm_price_field_value`
60 ADD `membership_type_id` int(10) unsigned default NULL COMMENT 'Conditional foreign key to civicrm_membership_type.id.',
61 ADD CONSTRAINT `FK_civicrm_price_field_value_membership_type_id` FOREIGN KEY (`membership_type_id`) REFERENCES `civicrm_membership_type` (`id`) ON DELETE SET NULL;
62
63SELECT @customizeID := MAX(id) FROM civicrm_navigation where name = 'Memberships';
64SELECT @extensionsWeight := MAX(weight)+1 FROM civicrm_navigation where parent_id = @customizeID;
65
66INSERT INTO civicrm_navigation
67 ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight )
10824d34 68VALUES
6a488035
TO
69 ( {$domainID}, 'civicrm/admin/price&reset=1&action=add', '{ts escape="sql" skip="true"}New Price Set{/ts}', 'New Price Set', 'access CiviMember,administer CiviCRM', '', @customizeID, '1', NULL, @extensionsWeight ),
70 ( {$domainID}, 'civicrm/admin/price&reset=1', '{ts escape="sql" skip="true"}Manage Price Sets{/ts}', 'Manage Price Sets', 'access CiviMember,administer CiviCRM', '', @customizeID, '1', NULL, @extensionsWeight+1 );
71
72SELECT @customizeID := MAX(id) FROM civicrm_navigation where name = 'CiviMember';
73SELECT @extensionsWeight := MAX(weight)+1 FROM civicrm_navigation where parent_id = @customizeID;
74
75INSERT INTO civicrm_navigation
76 ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight )
10824d34 77VALUES
6a488035
TO
78 ( {$domainID}, 'civicrm/admin/price&reset=1&action=add', '{ts escape="sql" skip="true"}New Price Set{/ts}', 'New Price Set', 'access CiviMember,administer CiviCRM', '', @customizeID, '1', NULL, @extensionsWeight ),
79 ( {$domainID}, 'civicrm/admin/price&reset=1', '{ts escape="sql" skip="true"}Manage Price Sets{/ts}', 'Manage Price Sets', 'access CiviMember,administer CiviCRM', '', @customizeID, '1', NULL, @extensionsWeight+1 );
10824d34 80
6a488035
TO
81
82-- CRM-8626
83UPDATE civicrm_payment_processor_type
84SET url_recur_default = 'https://checkout.google.com/',
85 url_recur_test_default = 'https://sandbox.google.com/checkout/',
86 is_recur = 1
87WHERE name = 'Google_Checkout';
88
89UPDATE civicrm_payment_processor
90 SET is_recur = 1,
91 url_recur = 'https://checkout.google.com/'
92 WHERE payment_processor_type = 'Google_Checkout' AND is_test = 0;
93
94UPDATE civicrm_payment_processor
95 SET is_recur = 1,
96 url_recur = 'https://sandbox.google.com/checkout/'
97 WHERE payment_processor_type = 'Google_Checkout' AND is_test = 1;