]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/meta.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 3 Apr 2018 14:12:32 +0000 (15:12 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 3 Apr 2018 14:12:32 +0000 (15:12 +0100)
etc/vim/source/vars.vim
lib/php/mime.php
lib/php/nb.php
lib/postgres/host.sql
lib/postgres/host_info.sql
lib/postgres/lang.sql
lib/postgres/meta.sql [new file with mode: 0644]
lib/postgres/zipcode.sql

index a83dcd7999fc01872ddef057faf9108bebd9245b..22fdcf6764409af3efa885e65e5c2a4d55b63926 100644 (file)
@@ -11,7 +11,6 @@ let mimeCheck = {
   \,'haproxy.cfg' : 'haproxy -c -f'
   \,'haproxy' : 'haproxy -c -f'
   \,'html' : 'xmllint --noout --html'
-  \,'id' : 'cmd_check'
   \,'init' : 'init-checkconf'
   \,'json' : 'ruby -rjson -e ''puts JSON.parse(File.read(ARGV[0]))'''
   \,'perl' : 'perl -c -w'
index 546072bc81d5a6e31f0eaa6d1dab6f7106d3f677..a246754bc2e98cb21c03e8317a4d15491392b54d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 class Mime {
        const Types = [
-#>SHELL_REPLACE nb_api '/pub/mime/ls/type,ext.php_hash?align=0&limit=5' | sed "s/^/$(printf '\t\t')/"
+#>SHELL_REPLACE nb_api '/pub/mime/ls/type,ext.php_hash' | sed "s/^/$(printf '\t\t')/"
                "application/applixware"                                                    => "aw",
                "application/atomcat+xml"                                                   => "atomcat",
                "application/atomsvc+xml"                                                   => "atomsvc",
index 11ff93066b31f15295d699ac1ec7baf2d484bda8..167a5f465a4186b04f1dc51ebf7852e6224175f7 100644 (file)
@@ -18,27 +18,12 @@ class NB {
        const NB_ROOT = NB_ROOT;
 
        protected static $content_types_aliases = array(
-               #>_SHELL_REPLACE dbq db=$NB_DB table="SELECT type,ext FROM mime_type WHERE ext IN ('json','csv','txt','yaml','xml','html','doc','xls')"
                'text' => 'txt',
                'human' => 'txt',
                'table' => 'html',
                'div' => 'html',
-               #<_SHELL_REPLACE
        );
 
-       # NB 19.01.18: TODEL 
-# NB 19.01.18  protected static $content_types = array(
-# NB 19.01.18          'json' => 'text/json',
-# NB 19.01.18          'doc'  => 'application/msword',
-# NB 19.01.18          'xls'  => 'application/vnd.ms-excel',
-# NB 19.01.18          'xml'  => 'application/xml',
-# NB 19.01.18          'txt'  => 'text/plain',
-# NB 19.01.18          'csv'  => 'text/csv',
-# NB 19.01.18          'html' => 'text/html',
-# NB 19.01.18          'yaml' => 'text/yaml',
-# NB 19.01.18          'php'  => 'text/x-php',
-# NB 19.01.18  );
-
        public function __construct($opt = array()) {
 
                # Deep merge of vars
index f1e3bd1a22a61eed8f3252a4f9eb34a7f50e5523..d161990dbfecdbc056d4a7fdb60605549f5ef76f 100644 (file)
@@ -4,4 +4,3 @@ CREATE VIEW host AS
        FROM host_info
        GROUP BY host
 ;
-GRANT ALL ON hostGRANT ALL ON ALL TABLES IN SCHEMA public TO TO nico,www;
index 18b4ab592e846684bd31c6abc7fdc6d4fd75b3db..a9123ef25d53530cff08e179143ee70adf0178e5 100644 (file)
@@ -11,4 +11,3 @@ CREATE INDEX IF NOT EXISTS host_info_host ON host_info USING btree (host);
 CREATE INDEX IF NOT EXISTS host_info_key ON host_info USING btree (key);
 CREATE INDEX IF NOT EXISTS host_info_val ON host_info USING btree (val);
 CREATE INDEX IF NOT EXISTS host_info_updated ON host_info USING btree (updated);
-GRANT ALL ON host_info TO nico,www;
index a892c1fe107356d2b7099411dc063ea5460a92b7..366cdf6f352ec9dc1e1594501cdef63c3e7b8daf 100644 (file)
@@ -3,9 +3,6 @@ CREATE TABLE IF NOT EXISTS lang (
   id char(3) PRIMARY KEY,
   name varchar(60)
 );
-GRANT ALL ON TABLE lang TO www;
-GRANT ALL ON TABLE lang TO nico;
-GRANT ALL ON TABLE lang TO root;
 BEGIN TRANSACTION;
 DELETE FROM lang;
 COPY lang FROM PROGRAM 'curl -s http://download.geonames.org/export/dump/iso-languagecodes.txt \
diff --git a/lib/postgres/meta.sql b/lib/postgres/meta.sql
new file mode 100644 (file)
index 0000000..b894224
--- /dev/null
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS meta;
+CREATE TABLE meta (
+       cat VARCHAR(200),       
+       key VARCHAR(100) NOT NULL,      
+       val VARCHAR(500) NOT NULL,      
+       updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+       -- PRIMARY KEY (cat,key,updated)
+       PRIMARY KEY (cat,key)
+);
+CREATE INDEX IF NOT EXISTS meta_cat ON meta USING btree (cat);
+CREATE INDEX IF NOT EXISTS meta_key ON meta USING btree (key);
+CREATE INDEX IF NOT EXISTS meta_val ON meta USING btree (val);
+CREATE INDEX IF NOT EXISTS meta_updated ON meta USING btree (updated);
index 3dec4592b9c5fcb4c705b0d99a3d341ae8f8bb71..3b2f4e768ead445cba70a55c5102984cf4b5001f 100644 (file)
@@ -18,10 +18,6 @@ CREATE INDEX IF NOT EXISTS zipcode_code_idx ON zipcode (code);
 CREATE INDEX IF NOT EXISTS zipcode_country_idx ON zipcode (country);
 CREATE INDEX IF NOT EXISTS zipcode_name_idx ON zipcode (name);
 
-GRANT ALL ON TABLE zipcode TO www;
-GRANT ALL ON TABLE zipcode TO nico;
-GRANT ALL ON TABLE zipcode TO root;
-
 BEGIN TRANSACTION;
 DELETE FROM zipcode;
 COPY zipcode FROM PROGRAM 'curl -s http://download.geonames.org/export/zip/allCountries.zip | zcat | sed "s,\\\\,\\\\\\\\,g"' WITH (format 'text', NULL '');