Commit | Line | Data |
---|---|---|
6456d08b | 1 | {* file to handle db changes in 4.6.3 during upgrade *} |
49a5ae18 DG |
2 | -- CRM-16307 fix CRM-15578 typo - Require access CiviMail permission for A/B Testing feature |
3 | UPDATE civicrm_navigation | |
4 | SET permission = 'access CiviMail', permission_operator = '' | |
75b065ce | 5 | WHERE name = 'New A/B Test' OR name = 'Manage A/B Tests'; |
6 | ||
7 | --CRM-16320 | |
8 | {include file='../CRM/Upgrade/4.6.3.msg_template/civicrm_msg_template.tpl'} | |
3feae72a SB |
9 | |
10 | -- CRM-16452 Missing administrative divisions for Georgia | |
4eed0569 | 11 | SELECT @country_id := id from civicrm_country where name = 'Georgia' AND iso_code = 'GE'; |
3feae72a SB |
12 | INSERT INTO civicrm_state_province (country_id, abbreviation, name) |
13 | VALUES | |
4eed0569 SB |
14 | (@country_id, "AB", "Abkhazia"), |
15 | (@country_id, "AJ", "Adjara"), | |
16 | (@country_id, "TB", "Tbilisi"), | |
17 | (@country_id, "GU", "Guria"), | |
18 | (@country_id, "IM", "Imereti"), | |
19 | (@country_id, "KA", "Kakheti"), | |
20 | (@country_id, "KK", "Kvemo Kartli"), | |
21 | (@country_id, "MM", "Mtskheta-Mtianeti"), | |
22 | (@country_id, "RL", "Racha-Lechkhumi and Kvemo Svaneti"), | |
23 | (@country_id, "SZ", "Samegrelo-Zemo Svaneti"), | |
24 | (@country_id, "SJ", "Samtskhe-Javakheti"), | |
25 | (@country_id, "SK", "Shida Kartli"); | |
7bdc0ff4 SB |
26 | |
27 | --CRM-16391 and CRM-16392 | |
28 | UPDATE civicrm_uf_field | |
29 | SET {localize field="label"}label = '{ts escape="sql"}Financial Type{/ts}'{/localize} | |
30 | WHERE field_type = 'Contribution' AND field_name='financial_type'; | |
31 | ||
32 | UPDATE civicrm_uf_field | |
33 | SET {localize field="label"}label = '{ts escape="sql"}Membership Type{/ts}'{/localize} | |
34 | WHERE field_type = 'Membership' AND field_name='membership_type'; | |
b324eace | 35 | |
b324eace | 36 | -- CRM-16367: adding the shared payment token table |
78c35cc9 | 37 | CREATE TABLE IF NOT EXISTS `civicrm_payment_token` ( |
b324eace RT |
38 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Payment Token ID', |
39 | `contact_id` int unsigned NOT NULL COMMENT 'FK to Contact ID for the owner of the token', | |
40 | `payment_processor_id` int unsigned NOT NULL , | |
41 | `token` varchar(255) NOT NULL COMMENT 'Externally provided token string', | |
3fd916ec | 42 | `created_date` timestamp DEFAULT CURRENT_TIMESTAMP COMMENT 'Date created', |
b324eace RT |
43 | `created_id` int unsigned COMMENT 'Contact ID of token creator', |
44 | `expiry_date` datetime COMMENT 'Date this token expires', | |
45 | `email` varchar(255) COMMENT 'Email at the time of token creation. Useful for fraud forensics', | |
46 | `billing_first_name` varchar(255) COMMENT 'Billing first name at the time of token creation. Useful for fraud forensics', | |
47 | `billing_middle_name` varchar(255) COMMENT 'Billing middle name at the time of token creation. Useful for fraud forensics', | |
48 | `billing_last_name` varchar(255) COMMENT 'Billing last name at the time of token creation. Useful for fraud forensics', | |
49 | `masked_account_number` varchar(255) COMMENT 'Holds the part of the card number or account details that may be retained or displayed', | |
78c35cc9 RT |
50 | `ip_address` varchar(255) COMMENT 'IP used when creating the token. Useful for fraud forensics' , |
51 | PRIMARY KEY ( `id` ), | |
52 | CONSTRAINT FK_civicrm_payment_token_contact_id FOREIGN KEY (`contact_id`) | |
53 | REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE, | |
54 | CONSTRAINT FK_civicrm_payment_token_payment_processor_id FOREIGN KEY (`payment_processor_id`) | |
55 | REFERENCES `civicrm_payment_processor`(`id`) ON DELETE RESTRICT, | |
56 | CONSTRAINT FK_civicrm_payment_token_created_id FOREIGN KEY (`created_id`) | |
b324eace | 57 | REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL |
78c35cc9 RT |
58 | ) |
59 | ENGINE=InnoDB DEFAULT | |
60 | CHARACTER SET utf8 | |
61 | COLLATE utf8_unicode_ci; | |
abd3a593 | 62 | |
63 | -- CRM-16367: adding a reference to the token table to the recurring contributions table. | |
64 | ALTER TABLE civicrm_contribution_recur | |
65 | ADD COLUMN `payment_token_id` int(10) unsigned DEFAULT NULL COMMENT 'Optionally used to store a link to a payment token used for this recurring contribution.', | |
66 | ADD CONSTRAINT `FK_civicrm_contribution_recur_payment_token_id` FOREIGN KEY (`payment_token_id`) REFERENCES `civicrm_payment_token` (`id`) ON DELETE SET NULL; | |
0576b84b SB |
67 | |
68 | --CRM-16480: set total_amount and financial_type fields 'is_required' to null | |
69 | SELECT @uf_group_id_contribution := max(id) from civicrm_uf_group where name = 'contribution_batch_entry'; | |
70 | SELECT @uf_group_id_membership := max(id) from civicrm_uf_group where name = 'membership_batch_entry'; | |
71 | ||
72 | UPDATE civicrm_uf_field | |
73 | SET is_required = 0 WHERE uf_group_id IN (@uf_group_id_contribution, @uf_group_id_membership) AND field_name IN ('financial_type', 'total_amount'); |