 COMMENT ON COLUMN link_review.recall_time IS 'Recall time is the amount of time (in milliseconds) taken to recall (or not) the destination of a link. It could be measured as the time between when the page is displayed and when the destination lexeme is shown (using JavaScript).';
 
 CREATE TABLE link_sm2 (
-       member_no INTEGER REFERENCES member (member_no) NOT NULL ON UPDATE CASCADE ON DELETE CASCADE,
-       link_no INTEGER REFERENCES link (link_no) NOT NULL ON UPDATE CASCADE ON DELETE CASCADE,
+       member_no INTEGER REFERENCES member (member_no) ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
+       link_no INTEGER REFERENCES link (link_no) ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
        n SMALLINT NOT NULL DEFAULT 1,
        EF REAL NOT NULL DEFAULT 2.5,
        PRIMARY KEY (member_no, link_no)

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 INDEX link_familiar_phrase_index ON link (familiar_phrase);

CREATE TABLE link_linkword (
       link_no INTEGER REFERENCES link (link_no) ON DELETE CASCADE NOT NULL PRIMARY KEY,
       linkword TEXT NOT NULL
);

CREATE TABLE link_soundalike (
       link_no INTEGER REFERENCES link (link_no) ON DELETE CASCADE NOT NULL PRIMARY KEY
);

CREATE TABLE linkword_story (
       story_no SERIAL PRIMARY KEY,
       link_no INTEGER REFERENCES link_type_linkword (link_no) ON DELETE CASCADE NOT NULL,
       author INTEGER REFERENCES member (member_no) ON DELETE CASCADE NOT NULL,
       created TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
       edited  TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
       story TEXT NOT NULL
);

CREATE TABLE link_to_review (
       member_no INTEGER REFERENCES member (member_no) ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
       link_no INTEGER REFERENCES link (link_no) ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
       target_time TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
       added_time TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
       PRIMARY KEY (member_no, link_no)
