 END; $$ LANGUAGE plpgsql;
 
 CREATE TABLE link_comment (
-       link_no INTEGER REFERENCES link (link_no) NOT NULL ON DELETE CASCADE,
-       root_comment INTEGER REFERENCES comment (comment_no) NOT NULL ON DELETE CASCADE,
+       link_no INTEGER REFERENCES link (link_no) ON DELETE CASCADE NOT NULL,
+       root_comment INTEGER REFERENCES comment (comment_no) ON DELETE CASCADE NOT NULL,
        PRIMARY KEY (link_no, root_comment)
 );
 

VALUES (0, 'anonymous', '');

CREATE TABLE member_confirmation (
       member_no INTEGER REFERENCES member (member_no) NOT NULL PRIMARY KEY ON DELETE CASCADE,
       hash TEXT NOT NULL,
       email TEXT NOT NULL,
       email_sent TIMESTAMP (0) WITH TIME ZONE


CREATE TABLE comment (
       comment_no SERIAL PRIMARY KEY,
       author INTEGER REFERENCES member (member_no) ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
       time TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
       body TEXT,
       parent_no INTEGER REFERENCES comment (comment_no) ON DELETE CASCADE
