Merge pull request #19435 from civicrm/5.34
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 5.31.alpha1.mysql.tpl
1 {* file to handle db changes in 5.31.alpha1 during upgrade *}
2
3 {* Remove Country & State special select fields *}
4 UPDATE civicrm_custom_field SET html_type = 'Select'
5 WHERE html_type IN ('Select Country', 'Select State/Province');
6
7 {* make period_type required - it already is so the update is precautionary *}
8 UPDATE civicrm_membership_type SET period_type = 'rolling' WHERE period_type IS NULL;
9 ALTER TABLE civicrm_membership_type MODIFY `period_type` varchar(8) NOT NULL COMMENT 'Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.';
10
11 {* dev/core#2027 Add missing sub-divisions for Northern Ireland and Wales *}
12 SET @UKCountryId = (SELECT id FROM civicrm_country cc WHERE cc.name = 'United Kingdom');
13 INSERT IGNORE INTO civicrm_state_province (country_id, abbreviation, name) VALUES
14 (@UKCountryId, "ANN", "Antrim and Newtownabbey"),
15 (@UKCountryId, "AND", "Ards and North Down"),
16 (@UKCountryId, "ABC", "Armagh City, Banbridge and Craigavon"),
17 (@UKCountryId, "BFS", "Belfast"),
18 (@UKCountryId, "CCG", "Causeway Coast and Glens"),
19 (@UKCountryId, "DRS", "Derry City and Strabane"),
20 (@UKCountryId, "FMO", "Fermanagh and Omagh"),
21 (@UKCountryId, "LBC", "Lisburn and Castlereagh"),
22 (@UKCountryId, "MEA", "Mid and East Antrim"),
23 (@UKCountryId, "MUL", "Mid Ulster"),
24 (@UKCountryId, "NMD", "Newry, Mourne and Down"),
25 (@UKCountryId, "BGW", "Blaenau Gwent"),
26 (@UKCountryId, "BGE", "Bridgend"),
27 (@UKCountryId, "CAY", "Caerphilly"),
28 (@UKCountryId, "CRF", "Cardiff"),
29 (@UKCountryId, "CRF", "Carmarthenshire"),
30 (@UKCountryId, "CGN", "Ceredigion"),
31 (@UKCountryId, "CWY", "Conwy"),
32 (@UKCountryId, "DEN", "Denbighshire"),
33 (@UKCountryId, "FLN", "Flintshire"),
34 (@UKCountryId, "AGY", "Isle of Anglesey"),
35 (@UKCountryId, "MTY", "Merthyr Tydfil"),
36 (@UKCountryId, "NTL", "Neath Port Talbot"),
37 (@UKCountryId, "NWP", "Newport"),
38 (@UKCountryId, "PEM", "Pembrokeshire"),
39 (@UKCountryId, "RCT", "Rhondda, Cynon, Taff"),
40 (@UKCountryId, "SWA", "Swansea"),
41 (@UKCountryId, "TOF", "Torfaen"),
42 (@UKCountryId, "VGL", "Vale of Glamorgan, The"),
43 (@UKCountryId, "WRX", "Wrexham");
44
45 ALTER TABLE civicrm_price_set MODIFY COLUMN `min_amount` decimal(20,2) DEFAULT '0.00' COMMENT 'Minimum Amount required for this set.';