word: prefer reference image id in exportform rows
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 14 Oct 2021 16:50:15 +0000 (18:50 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 25 Oct 2021 14:33:21 +0000 (16:33 +0200)
tools/word.pg.sql

index 4e5aca6d12a9017e21372e5b3d2b860cd9916af3..a142ebc6cab2215e16012ebccb52f4cbf33cb8d1 100644 (file)
@@ -56,7 +56,7 @@ COMMENT ON COLUMN kind.truth      IS 'link validity ranging from 0 (never) to 10
 
 CREATE OR REPLACE FUNCTION exportform(word) RETURNS text AS $$
        SELECT concat(
-               $1.id, ':',
+               coalesce($1.ref, $1.id), ':',
                $1.prio, CASE WHEN $1.cover THEN 'c' ELSE '' END, ':',
                array_to_string($1.form || $1.alt, '/')
        );