        link_no SERIAL PRIMARY KEY,
        foreign_phrase TEXT NOT NULL CHECK (length(foreign_phrase) > 0),
        familiar_phrase TEXT NOT NULL CHECK (length(familiar_phrase) > 0),
-       foreign_language CHARACTER VARYING (3) REFERENCES language (abbr) NOT NULL ON UPDATE CASCADE,
-       familiar_language CHARACTER VARYING (3) REFERENCES language (abbr) NOT NULL ON UPDATE CASCADE,
-       link_type TEXT REFERENCES link_type (name) NOT NULL ON UPDATE CASCADE,
-       author INTEGER REFERENCES member (member_no) NOT NULL ON UPDATE CASCADE,
+       foreign_language CHARACTER VARYING (3) REFERENCES language (abbr) ON UPDATE CASCADE NOT NULL,
+       familiar_language CHARACTER VARYING (3) REFERENCES language (abbr) ON UPDATE CASCADE NOT NULL,
+       link_type TEXT REFERENCES link_type (name) ON UPDATE CASCADE NOT NULL,
+       author INTEGER REFERENCES member (member_no) ON UPDATE CASCADE NOT NULL,
        created TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
        updated TIMESTAMP (0) WITH TIME ZONE NOT NULL DEFAULT current_timestamp,
        deleted BOOLEAN NOT NULL DEFAULT FALSE

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,
       link_no INTEGER REFERENCES link (link_no) NOT NULL ON UPDATE CASCADE,
       n SMALLINT NOT NULL DEFAULT 1,
       EF REAL NOT NULL DEFAULT 2.5,
       PRIMARY KEY (member_no, link_no)

);

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