metodisering
This commit is contained in:
parent
fdc02cdfcc
commit
a771b49ca7
14
db.lisp
14
db.lisp
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
(connect-toplevel "worblehat" "horace" "" "localhost")
|
(connect-toplevel "worblehat" "horace" "" "localhost")
|
||||||
|
|
||||||
(:create-table book
|
(defun create-tables ()
|
||||||
|
(:create-table book
|
||||||
((isbn :type string :primary-key t)
|
((isbn :type string :primary-key t)
|
||||||
(title :type string)
|
(title :type string)
|
||||||
(year :type integer)
|
(year :type integer)
|
||||||
|
@ -18,26 +19,23 @@
|
||||||
(author :type integer :unique t))
|
(author :type integer :unique t))
|
||||||
(:foreign-key (review) (review id))
|
(:foreign-key (review) (review id))
|
||||||
(:foreign-key (author) (author id)))
|
(:foreign-key (author) (author id)))
|
||||||
|
(:create-table review
|
||||||
(:create-table review
|
|
||||||
((id :type integer :primary-key t :references (book :cascade :cascade))
|
((id :type integer :primary-key t :references (book :cascade :cascade))
|
||||||
(review :type text)
|
(review :type text)
|
||||||
(grade :type integer)
|
(grade :type integer)
|
||||||
(author :type string)))
|
(author :type string)))
|
||||||
|
(:create-table author
|
||||||
(:create-table author
|
|
||||||
((id :type integer :primary-key t :references (book :cascade :cascade))
|
((id :type integer :primary-key t :references (book :cascade :cascade))
|
||||||
(surname :type string)
|
(surname :type string)
|
||||||
(lastname :type string)))
|
(lastname :type string)))
|
||||||
|
(:create-table copy
|
||||||
(:create-table copy
|
|
||||||
((id :type integer :primary-key t)
|
((id :type integer :primary-key t)
|
||||||
(shelf :type string)
|
(shelf :type string)
|
||||||
(rented :type boolean)
|
(rented :type boolean)
|
||||||
(owner :type string)
|
(owner :type string)
|
||||||
(condition :type string)
|
(condition :type string)
|
||||||
(book :type string))
|
(book :type string))
|
||||||
(:foreign-key (book) (book isbn)))
|
(:foreign-key (book) (book isbn))))
|
||||||
|
|
||||||
|
|
||||||
;(defclass book ()
|
;(defclass book ()
|
||||||
|
|
Reference in New Issue