Skip to content

Commit

Permalink
New table continent. Add country relation to continent table. New fie…
Browse files Browse the repository at this point in the history
…lds in country tld and dip (dial international prefix)
  • Loading branch information
gnovaro committed Oct 14, 2020
1 parent 1c68b43 commit efcbaff
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 260 deletions.
9 changes: 9 additions & 0 deletions 3166-country/001-3166_continent_structure.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS `continent` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`code` char(2) COLLATE utf8_unicode_ci NOT NULL,
`a2` char(2) COLLATE utf8_unicode_ci NULL,
`a3` char(3) COLLATE utf8_unicode_ci NULL,
`tld` char(3) COLLATE utf8_unicode_ci NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
7 changes: 7 additions & 0 deletions 3166-country/002-3166_continent_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(1,'Africa','AF', null, null, null);
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(2,'Antarctica','AN','aq','ATA','.aq');
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(3,'Asia','AS', null, null, null);
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(4,'Oceania','OC', null, null, null);
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(5,'Europe','EU',NULL, NULL, '.eu');
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(6,'North America','NA', null, null, null);
INSERT INTO continent (id,name,code,a2,a3,tld) VALUES(7,'South America','SA', null, null, null);
246 changes: 0 additions & 246 deletions 3166-country/002-3166_country_data.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
--
-- Table structure for table `countries`
--

DROP TABLE IF EXISTS country;
CREATE TABLE IF NOT EXISTS `country` (
`id` int(10) unsigned NOT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`continent_id` int(1) unsigned NULL,
`name` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
`a2` char(2) COLLATE utf8_unicode_ci NOT NULL,
`a3` char(3) COLLATE utf8_unicode_ci NOT NULL,
`tld` char(3) COLLATE utf8_unicode_ci NULL COMMENT 'Domain name TLD',
`dip` char(6) COLLATE utf8_unicode_ci NULL COMMENT 'Dial International Prefix code',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Expand Down
Loading

0 comments on commit efcbaff

Please sign in to comment.