From: Nicolas Boisselier Date: Tue, 9 Jan 2018 03:25:51 +0000 (+0000) Subject: lib/postgres/mime.sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=ea6bc655237357eb7ffc0bd4272f6967a04163b3;p=nb.git lib/postgres/mime.sql --- diff --git a/lib/postgres/mime.sql b/lib/postgres/mime.sql index e5d11309..6ca0a66b 100644 --- a/lib/postgres/mime.sql +++ b/lib/postgres/mime.sql @@ -716,5 +716,6 @@ COPY tmp_mime FROM PROGRAM 'true && curl -s \ https://gist.githubusercontent.com/electerious/3d5a31a73cfd6423f835c074ab25fc06/raw/d48b8410e9aa6746cfd946bca21a1bb54c351c4e/Caddyfile \ | sed -e "s/^ *//" -e "/^[^\.]/d" -e "s/ /\t/" -e "s/$/\t/" -e "s/^\.//" \ ' WITH (format 'text', NULL ''); +DELETE FROM tmp_mime WHERE LENGTH(ext)>4; INSERT INTO mime SELECT * FROM tmp_mime ON CONFLICT DO NOTHING; COMMIT;