Merge pull request #19232 from eileenmcnaughton/friend
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 4.7.9.mysql.tpl
CommitLineData
185aed97 1{* file to handle db changes in 4.7.9 during upgrade *}
cd095eae
CW
2
3-- CRM-17607 Change PDF activity type label
4SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
5UPDATE civicrm_option_value SET
6 {localize field="label"}label = '{ts escape="sql"}Print/Merge Document{/ts}'{/localize},
7 {localize field="description"}description = '{ts escape="sql"}Export letters and other printable documents.{/ts}'{/localize}
8WHERE name = 'Print PDF Letter' AND option_group_id = @option_group_id_act;
2be20a47
MN
9
10-- CRM-18699 Fix Wake Island misspelling, was Wake Ialand
11UPDATE civicrm_state_province SET name="Wake Island" WHERE name="Wake Ialand";
9a47de66 12
13-- CRM-18960 Change title in Getting Started widget
14UPDATE civicrm_dashboard SET
15 {localize field="label"}label = '{ts escape="sql"}CiviCRM Resources{/ts}'{/localize}
16WHERE name = 'getting-started';
fa1296c5
PN
17
18-- CRM-16189
19ALTER TABLE civicrm_financial_account
20 ADD `opening_balance` decimal(20,2) DEFAULT '0.00' COMMENT 'Contains the opening balance for this financial account',
21 ADD `current_period_opening_balance` decimal(20,2) DEFAULT '0.00' COMMENT 'Contains the opening balance for the current period for this financial account';
fb89c341
PN
22
23ALTER TABLE civicrm_contribution
24ADD `revenue_recognition_date` datetime DEFAULT NULL COMMENT 'Stores the date when revenue should be recognized.';
676cdbd1
PN
25
26-- CRM-16189 Financial account relationship
27SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = 'account_relationship';
28SELECT @option_group_id_arel_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel;
29SELECT @option_group_id_arel_val := MAX(CAST( `value` AS UNSIGNED )) FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel;
30
31INSERT INTO
32 `civicrm_option_value` (`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`)
33VALUES
5b001f7c 34(@option_group_id_arel, {localize}'{ts escape="sql"}Deferred Revenue Account is{/ts}'{/localize}, @option_group_id_arel_val+1, 'Deferred Revenue Account is', NULL, 0, 0, @option_group_id_arel_wt+1, {localize}'{ts escape="sql"}Deferred Revenue Account is{/ts}'{/localize}, 0, 1, 1, 2, NULL);
9845bedb
PN
35
36SELECT @option_group_id_fat := max(id) from civicrm_option_group where name = 'financial_account_type';
37SELECT @opLiability := value FROM civicrm_option_value WHERE name = 'Liability' and option_group_id = @option_group_id_fat;
38SELECT @domainContactId := contact_id from civicrm_domain where id = {$domainID};
39INSERT IGNORE INTO
40 `civicrm_financial_account` (`name`, `contact_id`, `financial_account_type_id`, `description`, `accounting_code`, `account_type_code`, `is_reserved`, `is_active`, `is_deductible`, `is_default`)
41VALUES
01eef925 42 ('Deferred Revenue - Event Fee', @domainContactId, @opLiability, 'Event revenue to be recognized in future months when the events occur', '2730', 'OCLIAB', 0, 1, 0, 0),
43 ('Deferred Revenue - Member Dues', @domainContactId, @opLiability, 'Membership revenue to be recognized in future months', '2740', 'OCLIAB', 0, 1, 0, 0);
9845bedb 44