X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/0d4c5ff9be0016264c0448df5f3ad5c4d95adeaa..dd92616a516d41f9a84d080891f18d5a58754060:/tools/word.pg.sql?ds=inline

diff --git a/tools/word.pg.sql b/tools/word.pg.sql
index d18a99c..3a0f158 100644
--- a/tools/word.pg.sql
+++ b/tools/word.pg.sql
@@ -13,7 +13,8 @@ CREATE TABLE word (
 	lang       text        NOT NULL DEFAULT 'en',
 	cat        integer              REFERENCES word (id),
 	ref        integer              REFERENCES word (id),
-	prio       smallint    NOT NULL DEFAULT '1',
+	prio       smallint             DEFAULT '1'
+	                                CHECK (prio >= 0 OR ref IS NOT NULL),
 	grade      integer,
 	cover      boolean     NOT NULL DEFAULT FALSE,
 	source     text,
