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