Post by Moggin » 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.

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; 
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.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by JAY6390 » Tue Aug 31, 2010 9:25 am

Hey Moggin,
As long as the id of the county is unique, and it's country ID relates to the country you want it to be in, you can pretty much edit it as you want

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Qphoria » Tue Aug 31, 2010 9:49 am

Yea, I used null so that the auto-increment would always have the correct id so there should be no problem using that bit from the upgrade.sql

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Moggin » Tue Aug 31, 2010 10:14 pm

Many thanks, Jay, and Qphoria! That's taken a small load off my mind. :)

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am
Who is online

Users browsing this forum: No registered users and 6 guests