X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Fds-nodes.lisp;h=50c6aea08b0de79b26f73938e458996f8a8af03f;hb=2259814df8868d2dcc653cd02126996284247f6b;hp=7a8c8a6250418ef82122f77e83f8813ba8fd152a;hpb=4b707b868821809b3a057c5e0f10c4e750e8b297;p=clsql.git diff --git a/tests/ds-nodes.lisp b/tests/ds-nodes.lisp index 7a8c8a6..50c6aea 100644 --- a/tests/ds-nodes.lisp +++ b/tests/ds-nodes.lisp @@ -19,7 +19,7 @@ -;; classes for testing the normalisedp stuff +;; classes for testing the normalizedp stuff (def-view-class node () ((node-id :accessor node-id :initarg :node-id :type integer :db-kind :key @@ -32,33 +32,34 @@ (def-view-class setting (node) ((setting-id :accessor setting-id :initarg :setting-id - :type integer :db-kind :key :db-constraints (:not-null)) + :type integer :db-kind :key :db-constraints (:not-null :auto-increment)) (vars :accessor vars :initarg :vars :type (varchar 240))) - (:normalisedp t)) + (:normalizedp t)) (def-view-class user (node) ((user-id :accessor user-id :initarg :user-id - :type integer :db-kind :key :db-constraints (:not-null)) + :type integer :db-kind :key :db-constraints (:not-null :auto-increment)) (nick :accessor nick :initarg :nick :type (varchar 64))) - (:normalisedp t)) + (:base-table "nodeuser") + (:normalizedp t)) (def-view-class theme (setting) ((theme-id :accessor theme-id :initarg :theme-id - :type integer :db-kind :key :db-constraints (:not-null)) + :type integer :db-kind :key :db-constraints (:not-null :auto-increment)) (doc :accessor doc :initarg :doc :type (varchar 240))) - (:normalisedp t)) + (:normalizedp t)) ;; A class that uses only a superclass db table (def-view-class location (node) () (:base-table node) - (:normalisedp t)) + (:normalizedp t)) (def-view-class subloc (location) ((subloc-id :accessor subloc-id :initarg :subloc-id - :type integer :db-kind :key :db-constraints (:not-null)) + :type integer :db-kind :key :db-constraints (:not-null :auto-increment)) (loc :accessor loc :initarg :loc :type (varchar 64))) - (:normalisedp t)) + (:normalizedp t)) @@ -112,6 +113,12 @@ (:setup initialize-ds-nodes) (:cleanup (lambda () (mapc #'clsql-sys:drop-view-from-class - '(node setting user theme location subloc))))) + '(node setting user theme location subloc)) + (ignore-errors + (clsql-sys:execute-command "DROP TABLE nodeuser") + (mapc #'clsql-sys:drop-sequence + '(node_node_id_seq setting_setting_id_seq subloc_subloc_id_seq + theme_theme_id_seq nodeuser_user_id_seq) + ))))) #.(clsql:restore-sql-reader-syntax-state)