# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: localhost (MySQL 5.5.38)
# Database: iris-locations-test
# Generation Time: 2015-06-05 17:44:38 +0000
# ************************************************************


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


# Dump of table addresses
# ------------------------------------------------------------

DROP TABLE IF EXISTS `addresses`;

CREATE TABLE `addresses` (
  `address_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `state_id` int(11) unsigned DEFAULT NULL,
  `country_id` int(11) unsigned DEFAULT NULL,
  `address_street_1` varchar(255) DEFAULT NULL,
  `address_street_2` varchar(255) DEFAULT NULL,
  `address_city` varchar(255) DEFAULT NULL,
  `address_zip` char(10) DEFAULT NULL,
  PRIMARY KEY (`address_id`),
  KEY `state_id` (`state_id`),
  KEY `country_id` (`country_id`),
  CONSTRAINT `addresses_ibfk_1` FOREIGN KEY (`state_id`) REFERENCES `states` (`state_id`) ON UPDATE CASCADE,
  CONSTRAINT `addresses_ibfk_2` FOREIGN KEY (`country_id`) REFERENCES `countries` (`country_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table countries
# ------------------------------------------------------------

DROP TABLE IF EXISTS `countries`;

CREATE TABLE `countries` (
  `country_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `country_code` char(2) NOT NULL DEFAULT '',
  `country_name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`country_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `countries` WRITE;
/*!40000 ALTER TABLE `countries` DISABLE KEYS */;

INSERT INTO `countries` (`country_id`, `country_code`, `country_name`)
VALUES
	(1,'AD','Andorra'),
	(2,'AE','United Arab Emirates'),
	(3,'AF','Afghanistan'),
	(4,'AG','Antigua and Barbuda'),
	(5,'AI','Anguilla'),
	(6,'AL','Albania'),
	(7,'AM','Armenia'),
	(8,'AO','Angola'),
	(9,'AQ','Antarctica'),
	(10,'AR','Argentina'),
	(11,'AS','American Samoa'),
	(12,'AT','Austria'),
	(13,'AU','Australia'),
	(14,'AW','Aruba'),
	(15,'AX','Åland'),
	(16,'AZ','Azerbaijan'),
	(17,'BA','Bosnia-Herzegovina'),
	(18,'BB','Barbados'),
	(19,'BD','Bangladesh'),
	(20,'BE','Belgium'),
	(21,'BF','Burkina Faso'),
	(22,'BG','Bulgaria'),
	(23,'BH','Bahrain'),
	(24,'BI','Burundi'),
	(25,'BJ','Benin'),
	(26,'BL','Saint Barthélemy'),
	(27,'BM','Bermuda'),
	(28,'BN','Brunei'),
	(29,'BO','Bolivia'),
	(30,'BQ','Bonaire, St Eustatius & Saba'),
	(31,'BR','Brazil'),
	(32,'BS','Bahamas'),
	(33,'BT','Bhutan'),
	(34,'BV','Bouvet Island'),
	(35,'BW','Botswana'),
	(36,'BY','Belarus'),
	(37,'BZ','Belize'),
	(38,'C-','Clipperton Island'),
	(39,'CA','Canada'),
	(40,'CC','Cocos (Keeling) Islands'),
	(41,'CD','Congo D.R.'),
	(42,'CF','Central African Rep.'),
	(43,'CG','Congo'),
	(44,'CH','Switzerland'),
	(45,'CI','Côte d\'Ivoire'),
	(46,'CK','Cook Islands'),
	(47,'CL','Chile'),
	(48,'CM','Cameroon'),
	(49,'CN','China'),
	(50,'CO','Colombia'),
	(51,'CR','Costa Rica'),
	(52,'CU','Cuba'),
	(53,'CV','Cape Verde'),
	(54,'CW','Curaçao'),
	(55,'CX','Christmas Island'),
	(56,'CY','Cyprus'),
	(57,'CZ','Czech Republic'),
	(58,'DE','Germany'),
	(59,'DJ','Djibouti'),
	(60,'DK','Denmark'),
	(61,'DM','Dominica'),
	(62,'DO','Dominican Republic'),
	(63,'DZ','Algeria'),
	(64,'EC','Ecuador'),
	(65,'EE','Estonia'),
	(66,'EG','Egypt'),
	(67,'EH','Western Sahara'),
	(68,'ER','Eritrea'),
	(69,'ES','Spain'),
	(70,'ET','Ethiopia'),
	(71,'FI','Finland'),
	(72,'FJ','Fiji'),
	(73,'FK','Falkland Islands'),
	(74,'FM','Micronesia'),
	(75,'FO','Faroe Islands'),
	(76,'FR','France'),
	(77,'GA','Gabon'),
	(78,'GB','United Kingdom'),
	(79,'GD','Grenada'),
	(80,'GE','Georgia'),
	(81,'GF','French Guiana'),
	(82,'GG','Guernsey'),
	(83,'GH','Ghana'),
	(84,'GI','Gibraltar'),
	(85,'GL','Greenland'),
	(86,'GM','Gambia'),
	(87,'GN','Guinea'),
	(88,'GP','Guadeloupe'),
	(89,'GQ','Equatorial Guinea'),
	(90,'GR','Greece'),
	(91,'GS','South Georgia & Sandwich'),
	(92,'GT','Guatemala'),
	(93,'GU','Guam'),
	(94,'GW','Guinea-Bissau'),
	(95,'GY','Guyana'),
	(96,'HK','Hong Kong'),
	(97,'HM','Heard & McDonald Islands'),
	(98,'HN','Honduras'),
	(99,'HR','Croatia'),
	(100,'HT','Haiti'),
	(101,'HU','Hungary'),
	(102,'ID','Indonesia'),
	(103,'IE','Ireland'),
	(104,'IL','Israel'),
	(105,'IM','Isle of Man'),
	(106,'IN','India'),
	(107,'IO','British Indian Ocean Terr.'),
	(108,'IQ','Iraq'),
	(109,'IR','Iran'),
	(110,'IS','Iceland'),
	(111,'IT','Italy'),
	(112,'JE','Jersey'),
	(113,'JM','Jamaica'),
	(114,'JO','Jordan'),
	(115,'JP','Japan'),
	(116,'KE','Kenya'),
	(117,'KG','Kyrgyzstan'),
	(118,'KH','Cambodia'),
	(119,'KI','Kiribati'),
	(120,'KM','Comoros'),
	(121,'KN','Saint Kitts and Nevis'),
	(122,'KP','North Korea'),
	(123,'KR','South Korea'),
	(124,'KW','Kuwait'),
	(125,'KY','Cayman Islands'),
	(126,'KZ','Kazakhstan'),
	(127,'LA','Laos'),
	(128,'LB','Lebanon'),
	(129,'LC','Saint Lucia'),
	(130,'LI','Liechtenstein'),
	(131,'LK','Sri Lanka'),
	(132,'LR','Liberia'),
	(133,'LS','Lesotho'),
	(134,'LT','Lithuania'),
	(135,'LU','Luxembourg'),
	(136,'LV','Latvia'),
	(137,'LY','Libya'),
	(138,'MA','Morocco'),
	(139,'MC','Monaco'),
	(140,'MD','Moldova'),
	(141,'ME','Montenegro'),
	(142,'MF','Saint Martin'),
	(143,'MG','Madagascar'),
	(144,'MH','Marshall Islands'),
	(145,'MK','Macedonia'),
	(146,'ML','Mali'),
	(147,'MM','Burma'),
	(148,'MN','Mongolia'),
	(149,'MO','Macau'),
	(150,'MP','Northern Mariana Islands'),
	(151,'MQ','Martinique'),
	(152,'MR','Mauritania'),
	(153,'MS','Montserrat'),
	(154,'MT','Malta'),
	(155,'MU','Mauritius'),
	(156,'MV','Maldives'),
	(157,'MW','Malawi'),
	(158,'MX','Mexico'),
	(159,'MY','Malaysia'),
	(160,'MZ','Mozambique'),
	(161,'NA','Namibia'),
	(162,'NC','New Caledonia'),
	(163,'NE','Niger'),
	(164,'NF','Norfolk Island'),
	(165,'NG','Nigeria'),
	(166,'NI','Nicaragua'),
	(167,'NL','Netherlands'),
	(168,'NO','Norway'),
	(169,'NP','Nepal'),
	(170,'NR','Nauru'),
	(171,'NU','Niue'),
	(172,'NZ','New Zealand'),
	(173,'OM','Oman'),
	(174,'P-','Paracel Islands'),
	(175,'PA','Panama'),
	(176,'PE','Peru'),
	(177,'PF','French Polynesia'),
	(178,'PG','Papua New Guinea'),
	(179,'PH','Philippines'),
	(180,'PK','Pakistan'),
	(181,'PL','Poland'),
	(182,'PM','Saint Pierre & Miquelon'),
	(183,'PN','Pitcairn Islands'),
	(184,'PR','Puerto Rico'),
	(185,'PS','Gaza Strip'),
	(186,'PT','Portugal'),
	(187,'PW','Palau'),
	(188,'PY','Paraguay'),
	(189,'QA','Qatar'),
	(190,'RE','Réunion'),
	(191,'RO','Romania'),
	(192,'RS','Serbia'),
	(193,'RU','Russia'),
	(194,'RW','Rwanda'),
	(195,'S-','Spratly Islands'),
	(196,'SA','Saudi Arabia'),
	(197,'SB','Solomon Islands'),
	(198,'SC','Seychelles'),
	(199,'SD','Sudan'),
	(200,'SE','Sweden'),
	(201,'SG','Singapore'),
	(202,'SH','Saint Helena'),
	(203,'SI','Slovenia'),
	(204,'SJ','Svalbard and Jan Mayen'),
	(205,'SK','Slovakia'),
	(206,'SL','Sierra Leone'),
	(207,'SM','San Marino'),
	(208,'SN','Senegal'),
	(209,'SO','Somalia'),
	(210,'SR','Suriname'),
	(211,'SS','South Sudan'),
	(212,'ST','Sao Tome and Principe'),
	(213,'SV','El Salvador'),
	(214,'SX','Sint Maarten'),
	(215,'SY','Syria'),
	(216,'SZ','Swaziland'),
	(217,'TC','Turks and Caicos Islands'),
	(218,'TD','Chad'),
	(219,'TF','French Southern Territories'),
	(220,'TG','Togo'),
	(221,'TH','Thailand'),
	(222,'TJ','Tajikistan'),
	(223,'TK','Tokelau'),
	(224,'TL','Timor-Leste'),
	(225,'TM','Turkmenistan'),
	(226,'TN','Tunisia'),
	(227,'TO','Tonga'),
	(228,'TR','Turkey'),
	(229,'TT','Trinidad and Tobago'),
	(230,'TV','Tuvalu'),
	(231,'TW','Taiwan'),
	(232,'TZ','Tanzania'),
	(233,'UA','Ukraine'),
	(234,'UG','Uganda'),
	(235,'UM','Minor Outlying Islands'),
	(236,'US','United States'),
	(237,'UY','Uruguay'),
	(238,'UZ','Uzbekistan'),
	(239,'VA','Vatican'),
	(240,'VC','St Vincent & the Grenadines'),
	(241,'VE','Venezuela'),
	(242,'VG','British Virgin Islands'),
	(243,'VI','Virgin Islands'),
	(244,'VN','Vietnam'),
	(245,'VU','Vanuatu'),
	(246,'WF','Wallis and Futuna'),
	(247,'WS','Samoa'),
	(248,'YE','Yemen'),
	(249,'YT','Mayotte'),
	(250,'ZA','South Africa'),
	(251,'ZM','Zambia'),
	(252,'ZW','Zimbabwe');

/*!40000 ALTER TABLE `countries` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table states
# ------------------------------------------------------------

DROP TABLE IF EXISTS `states`;

CREATE TABLE `states` (
  `state_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `country_id` int(11) unsigned DEFAULT NULL,
  `state_name` varchar(100) DEFAULT NULL,
  `state_code` char(3) DEFAULT NULL,
  PRIMARY KEY (`state_id`),
  KEY `country_id` (`country_id`),
  CONSTRAINT `states_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `countries` (`country_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `states` WRITE;
/*!40000 ALTER TABLE `states` DISABLE KEYS */;

INSERT INTO `states` (`state_id`, `country_id`, `state_name`, `state_code`)
VALUES
	(1,236,'Alabama','AL'),
	(2,236,'Alaska','AK'),
	(3,236,'Arizona','AZ'),
	(4,236,'Arkansas','AR'),
	(5,236,'California','CA'),
	(6,236,'Colorado','CO'),
	(7,236,'Connecticut','CT'),
	(8,236,'Delaware','DE'),
	(9,236,'District of Columbia','DC'),
	(10,236,'Florida','FL'),
	(11,236,'Georgia','GA'),
	(12,236,'Hawaii','HI'),
	(13,236,'Idaho','ID'),
	(14,236,'Illinois','IL'),
	(15,236,'Indiana','IN'),
	(16,236,'Iowa','IA'),
	(17,236,'Kansas','KS'),
	(18,236,'Kentucky','KY'),
	(19,236,'Louisiana','LA'),
	(20,236,'Maine','ME'),
	(21,236,'Maryland','MD'),
	(22,236,'Massachusetts','MA'),
	(23,236,'Michigan','MI'),
	(24,236,'Minnesota','MN'),
	(25,236,'Mississippi','MS'),
	(26,236,'Missouri','MO'),
	(27,236,'Montana','MT'),
	(28,236,'Nebraska','NE'),
	(29,236,'Nevada','NV'),
	(30,236,'New Hampshire','NH'),
	(31,236,'New Jersey','NJ'),
	(32,236,'New Mexico','NM'),
	(33,236,'New York','NY'),
	(34,236,'North Carolina','NC'),
	(35,236,'North Dakota','ND'),
	(36,236,'Ohio','OH'),
	(37,236,'Oklahoma','OK'),
	(38,236,'Oregon','OR'),
	(39,236,'Pennsylvania','PA'),
	(40,236,'Rhode Island','RI'),
	(41,236,'South Carolina','SC'),
	(42,236,'South Dakota','SD'),
	(43,236,'Tennessee','TN'),
	(44,236,'Texas','TX'),
	(45,236,'Utah','UT'),
	(46,236,'Vermont','VT'),
	(47,236,'Virginia','VA'),
	(48,236,'Washington','WA'),
	(49,236,'West Virginia','WV'),
	(50,236,'Wisconsin','WI'),
	(51,236,'Wyoming','WY'),
	(52,39,'Alberta','AB'),
	(53,39,'British Columbia','BC'),
	(54,39,'Manitoba','MB'),
	(55,39,'New Brunswick','NB'),
	(56,39,'Newfoundland and Labrador','NL'),
	(57,39,'Northwest Territories','NT'),
	(58,39,'Nova Scotia','NS'),
	(59,39,'Nunavut','NU'),
	(60,39,'Ontario','ON'),
	(61,39,'Prince Edward Island','PE'),
	(62,39,'Quebec','QC'),
	(63,39,'Saskatchewan','SK'),
	(64,39,'Yukon','YT'),
	(65,39,'Ottowa','OT');

/*!40000 ALTER TABLE `states` ENABLE KEYS */;
UNLOCK TABLES;



/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
