Mercurial > urweb
diff tests/cst.ur @ 712:915ec60592d4
More flexible foreign keying
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 09 Apr 2009 13:59:34 -0400 |
parents | 0406e9cccb72 |
children | baaae037e7f6 |
line wrap: on
line diff
--- a/tests/cst.ur Thu Apr 09 12:31:56 2009 -0400 +++ b/tests/cst.ur Thu Apr 09 13:59:34 2009 -0400 @@ -1,8 +1,9 @@ -table u : {C : int, D : int, E : int} +table u : {C : int, D : int, E : option int} PRIMARY KEY C, - CONSTRAINT U UNIQUE (C, D) + CONSTRAINT U UNIQUE (C, D), + CONSTRAINT U2 UNIQUE E -table t : {A : int, B : int} +table t : {A : int, B : int, C : option int} PRIMARY KEY B, CONSTRAINT UniA UNIQUE A, @@ -20,8 +21,10 @@ CONSTRAINT ForA FOREIGN KEY A REFERENCES u (C), CONSTRAINT ForAB FOREIGN KEY (A, B) REFERENCES u (D, C) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT ForBA FOREIGN KEY (A, B) REFERENCES u (C, D) ON UPDATE NO ACTION, + CONSTRAINT ForB FOREIGN KEY B REFERENCES u (E), + CONSTRAINT ForC FOREIGN KEY C REFERENCES u (C) - CONSTRAINT Self FOREIGN KEY B REFERENCES t (B) + (*CONSTRAINT Self FOREIGN KEY B REFERENCES t (B)*) table s : {B : option int} CONSTRAINT UniB UNIQUE B