##----------------------------------------------------------------------------------#
 # MusicMiner Web Server															#
 # Name:		source/app/sql/upgrade_1.2.4.7.sql									#
# Author:		Matthew Wright	(matt@soundminer.com)								#
 # Created:		2010-10-01															#
 # Updated:		2010-10-12															#
 # Compat:		MySQL 5.x																#
 # Copyright:	Copyright 2010 Soundminer Inc.										#
 # Purpose:		Upgrade the installed MusicMiner player and fix bugs.				#
 # Version:		1.2.4.7																#
 #----------------------------------------------------------------------------------#

# ********** Create countries table and info for new country field on registration. **********

use `mm_admin`;

CREATE TABLE IF NOT EXISTS `mm_admin`.`countries` 
 (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `iso` varchar(3) NOT NULL,
  `country_name` varchar(75) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_musicminer_countries_iso` (`iso`)
) ENGINE=MyISAM AUTO_INCREMENT=311 DEFAULT CHARSET=latin1;

DELETE FROM `mm_admin`.`countries`;

INSERT INTO `mm_admin`.`countries` (`id`,`iso`,`country_name`)
VALUES
	(65, 'abw', 'Aruba'),
	(66, 'afg', 'Afghanistan'),
	(67, 'ago', 'Angola'),
	(68, 'aia', 'Anguilla'),
	(69, 'ala', 'Aaland Islands'),
	(70, 'alb', 'Albania'),
	(71, 'and', 'Andorra'),
	(72, 'ant', 'Netherlands Antilles'),
	(73, 'are', 'United Arab Emirates'),
	(74, 'arg', 'Argentina'),
	(75, 'arm', 'Armenia'),
	(76, 'asm', 'American Samoa'),
	(77, 'ata', 'Antarctica'),
	(78, 'atf', 'French Southern Territories'),
	(79, 'atg', 'Antigua and Barbuda'),
	(80, 'aus', 'Australia'),
	(81, 'aut', 'Austria'),
	(82, 'aze', 'Azerbaijan'),
	(83, 'bdi', 'Burundi'),
	(84, 'bel', 'Belgium'),
	(85, 'ben', 'Benin'),
	(86, 'bfa', 'Burkina Faso'),
	(87, 'bgd', 'Bangladesh'),
	(88, 'bgr', 'Bulgaria'),
	(89, 'bhr', 'Bahrain'),
	(90, 'bhs', 'Bahamas'),
	(91, 'bih', 'Bosnia and Herzegovina'),
	(92, 'blm', 'Saint Barthélemy'),
	(93, 'blr', 'Belarus'),
	(94, 'blz', 'Belize'),
	(95, 'bmu', 'Bermuda'),
	(96, 'bol', 'Bolivia, Plurinational State of'),
	(97, 'bra', 'Brazil'),
	(98, 'brb', 'Barbados'),
	(99, 'brn', 'Brunei Darussalam'),
	(100, 'btn', 'Bhutan'),
	(101, 'bvt', 'Bouvet Island'),
	(102, 'bwa', 'Botswana'),
	(103, 'caf', 'Central African Republic'),
	(104, 'can', 'Canada'),
	(105, 'cck', 'Cocos (Keeling) Islands'),
	(106, 'che', 'Switzerland'),
	(107, 'chl', 'Chile'),
	(108, 'chn', 'China'),
	(109, 'civ', 'Côte d\'Ivoire'),
	(110, 'cmr', 'Cameroon'),
	(111, 'cod', 'Congo, the Democratic Republic of the'),
	(112, 'cog', 'Congo'),
	(113, 'cok', 'Cook Islands'),
	(114, 'col', 'Colombia'),
	(115, 'com', 'Comoros'),
	(116, 'cpv', 'Cape Verde'),
	(117, 'cri', 'Costa Rica'),
	(118, 'cub', 'Cuba'),
	(119, 'cxr', 'Christmas Island'),
	(120, 'cym', 'Cayman Islands'),
	(121, 'cyp', 'Cyprus'),
	(122, 'cze', 'Czech Republic'),
	(123, 'deu', 'Germany'),
	(124, 'dji', 'Djibouti'),
	(125, 'dma', 'Dominica'),
	(126, 'dnk', 'Denmark'),
	(127, 'dom', 'Dominican Republic'),
	(128, 'dza', 'Algeria'),
	(129, 'ecu', 'Ecuador'),
	(130, 'egy', 'Egypt'),
	(131, 'eri', 'Eritrea'),
	(132, 'esh', 'Western Sahara'),
	(133, 'esp', 'Spain'),
	(134, 'est', 'Estonia'),
	(135, 'eth', 'Ethiopia'),
	(136, 'fin', 'Finland'),
	(137, 'fji', 'Fiji'),
	(138, 'flk', 'Falkland Islands (Malvinas)'),
	(139, 'fra', 'France'),
	(140, 'fro', 'Faroe Islands'),
	(141, 'fsm', 'Micronesia, Federated States of'),
	(142, 'gab', 'Gabon'),
	(143, 'gbr', 'United Kingdom'),
	(144, 'geo', 'Georgia'),
	(145, 'ggy', 'Guernsey'),
	(146, 'gha', 'Ghana'),
	(147, 'gib', 'Gibraltar'),
	(148, 'gin', 'Guinea'),
	(149, 'glp', 'Guadeloupe'),
	(150, 'gmb', 'Gambia'),
	(151, 'gnb', 'Guinea-Bissau'),
	(152, 'gnq', 'Equatorial Guinea'),
	(153, 'grc', 'Greece'),
	(154, 'grd', 'Grenada'),
	(155, 'grl', 'Greenland'),
	(156, 'gtm', 'Guatemala'),
	(157, 'guf', 'French Guiana'),
	(158, 'gum', 'Guam'),
	(159, 'guy', 'Guyana'),
	(160, 'hkg', 'Hong Kong'),
	(161, 'hmd', 'Heard Island and McDonald Islands'),
	(162, 'hnd', 'Honduras'),
	(163, 'hrv', 'Croatia'),
	(164, 'hti', 'Haiti'),
	(165, 'hun', 'Hungary'),
	(166, 'idn', 'Indonesia'),
	(167, 'imn', 'Isle of Man'),
	(168, 'ind', 'India'),
	(169, 'iot', 'British Indian Ocean Territory'),
	(170, 'irl', 'Ireland'),
	(171, 'irn', 'Iran, Islamic Republic of'),
	(172, 'irq', 'Iraq'),
	(173, 'isl', 'Iceland'),
	(174, 'isr', 'Israel'),
	(175, 'ita', 'Italy'),
	(176, 'jam', 'Jamaica'),
	(177, 'jey', 'Jersey'),
	(178, 'jor', 'Jordan'),
	(179, 'jpn', 'Japan'),
	(180, 'kaz', 'Kazakhstan'),
	(181, 'ken', 'Kenya'),
	(182, 'kgz', 'Kyrgyzstan'),
	(183, 'khm', 'Cambodia'),
	(184, 'kir', 'Kiribati'),
	(185, 'kna', 'Saint Kitts and Nevis'),
	(186, 'kor', 'Korea, Republic of'),
	(187, 'kwt', 'Kuwait'),
	(188, 'lao', 'Lao People\'s Democratic Republic'),
	(189, 'lbn', 'Lebanon'),
	(190, 'lbr', 'Liberia'),
	(191, 'lby', 'Libyan Arab Jamahiriya'),
	(192, 'lca', 'Saint Lucia'),
	(193, 'lie', 'Liechtenstein'),
	(194, 'lka', 'Sri Lanka');

INSERT INTO `countries` (`id`,`iso`,`country_name`)
VALUES
	(195, 'lso', 'Lesotho'),
	(196, 'ltu', 'Lithuania'),
	(197, 'lux', 'Luxembourg'),
	(198, 'lva', 'Latvia'),
	(199, 'mac', 'Macao'),
	(200, 'maf', 'Saint Martin (French part)'),
	(201, 'mar', 'Morocco'),
	(202, 'mco', 'Monaco'),
	(203, 'mda', 'Moldova, Republic of'),
	(204, 'mdg', 'Madagascar'),
	(205, 'mdv', 'Maldives'),
	(206, 'mex', 'Mexico'),
	(207, 'mhl', 'Marshall Islands'),
	(208, 'mkd', 'Macedonia, the former Yugoslav Republic of'),
	(209, 'mli', 'Mali'),
	(210, 'mlt', 'Malta'),
	(211, 'mmr', 'Myanmar'),
	(212, 'mne', 'Montenegro'),
	(213, 'mng', 'Mongolia'),
	(214, 'mnp', 'Northern Mariana Islands'),
	(215, 'moz', 'Mozambique'),
	(216, 'mrt', 'Mauritania'),
	(217, 'msr', 'Montserrat'),
	(218, 'mtq', 'Martinique'),
	(219, 'mus', 'Mauritius'),
	(220, 'mwi', 'Malawi'),
	(221, 'mys', 'Malaysia'),
	(222, 'myt', 'Mayotte'),
	(223, 'nam', 'Namibia'),
	(224, 'ncl', 'New Caledonia'),
	(225, 'ner', 'Niger'),
	(226, 'nfk', 'Norfolk Island'),
	(227, 'nga', 'Nigeria'),
	(228, 'nic', 'Nicaragua'),
	(229, 'niu', 'Niue'),
	(230, 'nld', 'Netherlands'),
	(231, 'nor', 'Norway'),
	(232, 'npl', 'Nepal'),
	(233, 'nru', 'Nauru'),
	(234, 'nzl', 'New Zealand'),
	(235, 'omn', 'Oman'),
	(236, 'pak', 'Pakistan'),
	(237, 'pan', 'Panama'),
	(238, 'pcn', 'Pitcairn'),
	(239, 'per', 'Peru'),
	(240, 'phl', 'Philippines'),
	(241, 'plw', 'Palau'),
	(242, 'png', 'Papua New Guinea'),
	(243, 'pol', 'Poland'),
	(244, 'pri', 'Puerto Rico'),
	(245, 'prk', 'Korea, Democratic People\'s Republic of'),
	(246, 'prt', 'Portugal'),
	(247, 'pry', 'Paraguay'),
	(248, 'pse', 'Palestinian Territory, Occupied'),
	(249, 'pyf', 'French Polynesia'),
	(250, 'qat', 'Qatar'),
	(251, 'reu', 'Réunion'),
	(252, 'rou', 'Romania'),
	(253, 'rus', 'Russian Federation'),
	(254, 'rwa', 'Rwanda'),
	(255, 'sau', 'Saudi Arabia'),
	(256, 'sdn', 'Sudan'),
	(257, 'sen', 'Senegal'),
	(258, 'sgp', 'Singapore'),
	(259, 'sgs', 'South Georgia and the South Sandwich Islands'),
	(260, 'shn', 'Saint Helena, Ascension and Tristan da Cunha'),
	(261, 'sjm', 'Svalbard and Jan Mayen'),
	(262, 'slb', 'Solomon Islands'),
	(263, 'sle', 'Sierra Leone'),
	(264, 'slv', 'El Salvador'),
	(265, 'smr', 'San Marino'),
	(266, 'som', 'Somalia'),
	(267, 'spm', 'Saint Pierre and Miquelon'),
	(268, 'srb', 'Serbia'),
	(269, 'stp', 'Sao Tome and Principe'),
	(270, 'sur', 'Suriname'),
	(271, 'svk', 'Slovakia'),
	(272, 'svn', 'Slovenia'),
	(273, 'swe', 'Sweden'),
	(274, 'swz', 'Swaziland'),
	(275, 'syc', 'Seychelles'),
	(276, 'syr', 'Syrian Arab Republic'),
	(277, 'tca', 'Turks and Caicos Islands'),
	(278, 'tcd', 'Chad'),
	(279, 'tgo', 'Togo'),
	(280, 'tha', 'Thaiiiiland'),
	(281, 'tjk', 'Tajikistan'),
	(282, 'tkl', 'Tokelau'),
	(283, 'tkm', 'Turkmenistan'),
	(284, 'tls', 'Timor-Leste'),
	(285, 'ton', 'Tonga'),
	(286, 'tto', 'Trinidad and Tobago'),
	(287, 'tun', 'Tunisia'),
	(288, 'tur', 'Turkey'),
	(289, 'tuv', 'Tuvalu'),
	(290, 'twn', 'Taiwan, Province of China'),
	(291, 'tza', 'Tanzania, United Republic of'),
	(292, 'uga', 'Uganda'),
	(293, 'ukr', 'Ukraine'),
	(294, 'umi', 'United States Minor Outlying Islands'),
	(295, 'ury', 'Uruguay'),
	(296, 'usa', 'United States'),
	(297, 'uzb', 'Uzbekistan'),
	(298, 'vat', 'Holy See (Vatican City State)'),
	(299, 'vct', 'Saint Vincent and the Grenadines'),
	(300, 'ven', 'Venezuela, Bolivarian Republic of'),
	(301, 'vgb', 'Virgin Islands, British'),
	(302, 'vir', 'Virgin Islands, U.S.'),
	(303, 'vnm', 'Viet Nam'),
	(304, 'vut', 'Vanuatu'),
	(305, 'wlf', 'Wallis and Futuna'),
	(306, 'wsm', 'Samoa'),
	(307, 'yem', 'Yemen'),
	(308, 'zaf', 'South Africa'),
	(309, 'zmb', 'Zambia'),
	(310, 'zwe', 'Zimbabwe');

