summaryrefslogtreecommitdiff
path: root/tests/cst.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-09 13:59:34 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-09 13:59:34 -0400
commitf181919900b537dca8d42760c4131da446a7e00d (patch)
treeff692444e26cba80b8c5b19ad5be21a85cbf563c /tests/cst.ur
parenta8cf53e348e3b6d99a66a897f90de9aa523c9b40 (diff)
More flexible foreign keying
Diffstat (limited to 'tests/cst.ur')
-rw-r--r--tests/cst.ur11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/cst.ur b/tests/cst.ur
index 548862be..cbaa36ed 100644
--- a/tests/cst.ur
+++ b/tests/cst.ur
@@ -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 @@ table t : {A : int, B : int}
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