Merge pull request #19232 from eileenmcnaughton/friend
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 4.5.beta9.mysql.tpl
1 {* file to handle db changes in 4.5.beta9 during upgrade *}
2
3 -- CRM-15211
4 UPDATE `civicrm_dashboard` SET `permission` = 'access my cases and activities,access all cases and activities', `permission_operator` = 'OR' WHERE `name` = 'casedashboard';
5
6 -- CRM-15218
7 UPDATE `civicrm_uf_group` SET name = LOWER(name) WHERE name IN ("New_Individual", "New_Organization", "New_Household");
8
9 -- CRM-15220
10 UPDATE `civicrm_navigation` SET url = 'civicrm/admin/options/grant_type?reset=1' WHERE url = 'civicrm/admin/options/grant_type&reset=1';
11
12 SELECT @parent_id := `id` FROM `civicrm_navigation` WHERE `name` = 'CiviGrant' AND `domain_id` = {$domainID};
13 INSERT INTO civicrm_navigation
14 ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight )
15 VALUES
16 ( {$domainID}, 'civicrm/admin/options/grant_status?reset=1', '{ts escape="sql" skip="true"}Grant Status{/ts}', 'Grant Status', 'access CiviGrant,administer CiviCRM', 'AND', @parent_id, '1', NULL, 2 );
17
18 -- CRM-14853
19 UPDATE civicrm_financial_trxn cft
20 INNER JOIN ( SELECT max(cft.id) trxn_id, ceft.entity_id contribution_id
21 FROM civicrm_financial_trxn cft
22 LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.financial_trxn_id = cft.id
23 WHERE ceft.entity_table = 'civicrm_contribution'
24 GROUP BY ceft.entity_id ) as temp ON temp.trxn_id = cft.id
25 INNER JOIN civicrm_contribution cc ON cc.id = temp.contribution_id
26 AND cc.payment_instrument_id <> cft.payment_instrument_id
27 SET cft.payment_instrument_id = cc.payment_instrument_id;
28
29 --CRM-15086
30 SELECT @option_group_id_batch_status := id FROM civicrm_option_group WHERE name = 'batch_status';
31
32 UPDATE civicrm_option_value SET name = 'Open' WHERE value = 1 AND option_group_id = @option_group_id_batch_status;
33 UPDATE civicrm_option_value SET name = 'Closed' WHERE value = 2 AND option_group_id = @option_group_id_batch_status;
34 UPDATE civicrm_option_value SET name = 'Data Entry' WHERE value = 3 AND option_group_id = @option_group_id_batch_status;
35 UPDATE civicrm_option_value SET name = 'Reopened' WHERE value = 4 AND option_group_id = @option_group_id_batch_status;
36 UPDATE civicrm_option_value SET name = 'Exported' WHERE value = 5 AND option_group_id = @option_group_id_batch_status;