word: validate source values as http urls
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 15 Jun 2020 22:24:42 +0000 (00:24 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 20 Oct 2020 20:49:11 +0000 (22:49 +0200)
tools/word.pg.sql

index 3c05c3865b6405ca4d00330d826053b67a65df18..1bc5dffcc78e25f5dea4d0dee6164a6069f71ef9 100644 (file)
@@ -17,7 +17,7 @@ CREATE TABLE word (
                                        CHECK (prio >= 0 OR ref IS NOT NULL),
        grade      integer,
        cover      boolean     NOT NULL DEFAULT FALSE,
-       source     text,
+       source     text                 CHECK (source ~ '^https?://'),
        thumb      text[],
        wptitle    text,
        created    timestamptz          DEFAULT now(),