Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
submarine
submarine
Commits
4e0e0722
Commit
4e0e0722
authored
Sep 16, 2007
by
Ryszard Szopa
Browse files
Bugfix: unique constraints for single slots.
darcs-hash:83fc346a06be6a9f70ff9601368dbdb09e73f44d
parent
16f91c22
Changes
2
Hide whitespace changes
Inline
Side-by-side
db.lisp
View file @
4e0e0722
...
...
@@ -104,7 +104,7 @@ be reverted.)"
(
otherwise
(
on-delete
slot
)))))
(
defmethod
add-constraint
((
slot
db-class-slot-definition
)
(
constraint
(
eql
:unique
)))
(
format
nil
"UNIQUE
~A
"
(
format
nil
"UNIQUE
\(~A\)
"
(
sql-ize
(
slot-definition-name
slot
))))
(
defmethod
add-constraint
((
list
list
)
(
constraint
(
eql
:unique
)))
...
...
submarine-tests.lisp
View file @
4e0e0722
...
...
@@ -300,11 +300,16 @@ metaclass set to HTML and the right connection-spec."
((
foo
:type
integer
:accessor
foo
:initarg
:foo
)
(
bar
:type
integer
:accessor
bar
:initarg
:bar
))
(
:unique
(
foo
bar
))))
(
finishes
(
defdao-example
seis
()
((
foo
:type
integer
:accessor
foo
:initarg
:foo
:unique
t
))))
(
make-and-save
'cinco
:foo
1
:bar
1
)
(
finishes
(
make-and-save
'cinco
:foo
1
:bar
2
))
(
finishes
(
make-and-save
'cinco
:foo
2
:bar
1
))
(
signals
cl-postgres:database-error
(
make-and-save
'cinco
:foo
1
:bar
1
)))
(
signals
cl-postgres:database-error
(
make-and-save
'cinco
:foo
1
:bar
1
))
(
make-and-save
'seis
:foo
1
)
(
signals
cl-postgres:database-error
(
make-and-save
'seis
:foo
1
)))
;;; Copyright (C) 2007
;;; Ryszard Szopa <ryszard.szopa@gmail.com> &
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment