From: Nicolas Boisselier Date: Sat, 6 Jan 2018 02:40:47 +0000 (+0000) Subject: lib/postgres/geo.sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=5c7be7e1fdaab2e969a15c0231ec758a2e57714e;p=nb.git lib/postgres/geo.sql --- diff --git a/lib/postgres/continent.sql b/lib/postgres/continent.sql index 14cceb10..2f458c3f 100644 --- a/lib/postgres/continent.sql +++ b/lib/postgres/continent.sql @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS continent; CREATE TABLE IF NOT EXISTS continent ( id char(3) PRIMARY KEY, - name varchar(200), + name varchar(13), geoid bigint UNIQUE ); BEGIN TRANSACTION; diff --git a/lib/postgres/host_ads.sql b/lib/postgres/host_ads.sql deleted file mode 100644 index 55c53551..00000000 --- a/lib/postgres/host_ads.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS host_ads; -CREATE TABLE IF NOT EXISTS host_ads ( - host varchar(300) PRIMARY KEY -); -BEGIN TRANSACTION; -DELETE FROM host_ads; -COPY host_ads FROM PROGRAM 'curl -s http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml' WITH (format 'text', NULL ''); -COMMIT; diff --git a/lib/postgres/hostads.sql b/lib/postgres/hostads.sql new file mode 100644 index 00000000..d69bb3b3 --- /dev/null +++ b/lib/postgres/hostads.sql @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS hostads; +CREATE TABLE IF NOT EXISTS hostads ( + host varchar(50) PRIMARY KEY +); +BEGIN TRANSACTION; +DELETE FROM hostads; +COPY hostads FROM PROGRAM 'curl -s http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml' WITH (format 'text', NULL ''); +COMMIT; diff --git a/lib/postgres/lang.sql b/lib/postgres/lang.sql index 3a166551..9af851c1 100644 --- a/lib/postgres/lang.sql +++ b/lib/postgres/lang.sql @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS lang; CREATE TABLE IF NOT EXISTS lang ( id char(3) PRIMARY KEY, - name varchar(200) + name varchar(60) ); GRANT ALL ON TABLE lang TO www; GRANT ALL ON TABLE lang TO nico; diff --git a/lib/postgres/timezone.sql b/lib/postgres/timezone.sql index 694887b0..4bc81417 100644 --- a/lib/postgres/timezone.sql +++ b/lib/postgres/timezone.sql @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS timezone; CREATE TABLE IF NOT EXISTS timezone ( id varchar(2), - name varchar(300), + name varchar(30), gmt decimal(3,1), dst decimal(3,1), raw decimal(3,1)