Add countries/install/tables.sql
This commit is contained in:
commit
3a89a98ea5
26
countries/install/tables.sql
Normal file
26
countries/install/tables.sql
Normal file
@ -0,0 +1,26 @@
|
||||
-- Table: country_codes
|
||||
CREATE TABLE `country_codes` (
|
||||
`iso_3166_alpha2` CHAR(2) NOT NULL,
|
||||
PRIMARY KEY (`iso_3166_alpha2`)
|
||||
) ENGINE=InnoDB
|
||||
DEFAULT CHARSET=utf8mb4
|
||||
COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- Table: country_networks
|
||||
CREATE TABLE `country_networks` (
|
||||
`ip_country` CHAR(2) NOT NULL,
|
||||
`ip_network` VARCHAR(15) NOT NULL,
|
||||
`ip_network_bitmask` TINYINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (
|
||||
`ip_country`,
|
||||
`ip_network`,
|
||||
`ip_network_bitmask`
|
||||
),
|
||||
CONSTRAINT `fk_country_networks_country_codes`
|
||||
FOREIGN KEY (`ip_country`)
|
||||
REFERENCES `country_codes` (`iso_3166_alpha2`)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB
|
||||
DEFAULT CHARSET=utf8mb4
|
||||
COLLATE=utf8mb4_unicode_ci;
|
||||
Loading…
x
Reference in New Issue
Block a user