unicode: colour blocks row of hues in unicode 12.0
[sheet.git] / tools / word.pg.sql
index 4e5aca6d12a9017e21372e5b3d2b860cd9916af3..821814d1f18a828d983a479a137e9ef32173f905 100644 (file)
@@ -8,9 +8,9 @@ CREATE TABLE login (
 );
 
 CREATE TABLE word (
 );
 
 CREATE TABLE word (
-       form       text        NOT NULL,
+       form       text,
        alt        text[],
        alt        text[],
-       lang       text        NOT NULL DEFAULT 'en',
+       lang       text                 DEFAULT 'en',
        cat        integer              REFERENCES word (id),
        ref        integer              REFERENCES word (id),
        prio       smallint             DEFAULT '1'
        cat        integer              REFERENCES word (id),
        ref        integer              REFERENCES word (id),
        prio       smallint             DEFAULT '1'
@@ -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(
 
 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, '/')
        );
                $1.prio, CASE WHEN $1.cover THEN 'c' ELSE '' END, ':',
                array_to_string($1.form || $1.alt, '/')
        );