]> Some of my projects - localmylist.git/commitdiff
Add check to make sure that either aid or fid is set for a mylist update
authorAPTX <marek321@gmail.com>
Wed, 10 Apr 2013 14:27:57 +0000 (16:27 +0200)
committerAPTX <marek321@gmail.com>
Wed, 10 Apr 2013 14:27:57 +0000 (16:27 +0200)
localmylist/share/schema/schema.sql

index 43b11a7af49ce1c5ee1df3a784af2d0ecd2c1a27..8888ffe6e5e4b659c7f26957cc26a0d5f925e89f 100644 (file)
@@ -175,7 +175,8 @@ CREATE TABLE pending_mylist_update
        started timestamp without time zone,
        finished timestamp without time zone,
        fail_count integer NOT NULL DEFAULT 0,
-       CONSTRAINT pending_mylist_update_pk PRIMARY KEY (update_id )
+       CONSTRAINT pending_mylist_update_pk PRIMARY KEY (update_id),
+       CONSTRAINT pending_mylist_update_valid_id_check CHECK (aid > 0 OR fid > 0)
 );
 
 CREATE TABLE pending_request (