Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

metodisering

This commit is contained in:
Tiril Anette Langfeldt Rødland 2009-07-04 13:22:14 +00:00
parent fdc02cdfcc
commit a771b49ca7
1 changed files with 32 additions and 34 deletions

66
db.lisp
View File

@ -4,40 +4,38 @@
(connect-toplevel "worblehat" "horace" "" "localhost") (connect-toplevel "worblehat" "horace" "" "localhost")
(:create-table book (defun create-tables ()
((isbn :type string :primary-key t) (:create-table book
(title :type string) ((isbn :type string :primary-key t)
(year :type integer) (title :type string)
(publisher :type string) (year :type integer)
(udc :type string) (publisher :type string)
(edition :type integer) (udc :type string)
(picture :type string) (edition :type integer)
(description :type (or db-null text)) (picture :type string)
(language :type string) (description :type (or db-null text))
(review :type integer :unique t) (language :type string)
(author :type integer :unique t)) (review :type integer :unique t)
(:foreign-key (review) (review id)) (author :type integer :unique t))
(:foreign-key (author) (author id))) (:foreign-key (review) (review 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
((id :type integer :primary-key t)
(:create-table copy (shelf :type string)
((id :type integer :primary-key t) (rented :type boolean)
(shelf :type string) (owner :type string)
(rented :type boolean) (condition :type string)
(owner :type string) (book :type string))
(condition :type string) (:foreign-key (book) (book isbn))))
(book :type string))
(:foreign-key (book) (book isbn)))
;(defclass book () ;(defclass book ()