Insert NI counties into v1.4.8b DB
Posted: Mon Aug 30, 2010 10:01 pm
Can I update a 1.4.8b database to include the Northern Ireland counties, included in 1.4.9?
I pulled this directly from the upgrade.sql file, and executed it in phpmyadmin, on a test installation. It seemed to work: can anyone foresee any problems (bearing in mind I'm a MySQL noob?)
I understand the warning about DB prefixes, which is also in the file.
Could I also use it as a template to put in a new UK county; eg if a new county of Mogland was declared, or something?
Thanks to anyone who can spare time to glance at this.
I pulled this directly from the upgrade.sql file, and executed it in phpmyadmin, on a test installation. It seemed to work: can anyone foresee any problems (bearing in mind I'm a MySQL noob?)
I understand the warning about DB prefixes, which is also in the file.
Code: Select all
DELETE FROM `zone` WHERE `code` = 'ANT';
DELETE FROM `zone` WHERE `code` = 'ARM';
DELETE FROM `zone` WHERE `code` = 'DOW';
DELETE FROM `zone` WHERE `code` = 'FER';
DELETE FROM `zone` WHERE `code` = 'LDY';
DELETE FROM `zone` WHERE `code` = 'TYR';
INSERT INTO `zone` (`zone_id`, `country_id`, `code`, `name`, `status`) VALUES (NULL, 222, 'ANT', 'County Antrim', 1) ON DUPLICATE KEY UPDATE zone_id=zone_id;
INSERT INTO `zone` (`zone_id`, `country_id`, `code`, `name`, `status`) VALUES (NULL, 222, 'ARM', 'County Armagh', 1) ON DUPLICATE KEY UPDATE zone_id=zone_id;
INSERT INTO `zone` (`zone_id`, `country_id`, `code`, `name`, `status`) VALUES (NULL, 222, 'DOW', 'County Down', 1) ON DUPLICATE KEY UPDATE zone_id=zone_id;
INSERT INTO `zone` (`zone_id`, `country_id`, `code`, `name`, `status`) VALUES (NULL, 222, 'FER', 'County Fermanagh', 1) ON DUPLICATE KEY UPDATE zone_id=zone_id;
INSERT INTO `zone` (`zone_id`, `country_id`, `code`, `name`, `status`) VALUES (NULL, 222, 'LDY', 'County Londonderry', 1) ON DUPLICATE KEY UPDATE zone_id=zone_id;
INSERT INTO `zone` (`zone_id`, `country_id`, `code`, `name`, `status`) VALUES (NULL, 222, 'TYR', 'County Tyrone', 1) ON DUPLICATE KEY UPDATE zone_id=zone_id;
Thanks to anyone who can spare time to glance at this.