Commit eb30cdbb authored by Ryszard Szopa's avatar Ryszard Szopa
Browse files

database-consistent-with-specification test case and partial bugfix

d-c-w-s causes an error when you provide as a type of a column
things like (string 5). I partially fixed it (it still throws an
unnecessary condition, but a good fix is srill necessary.

darcs-hash:51b1fc453b577a4a4ebd110606d77d136772e42b
parent d71786c4
......@@ -160,10 +160,14 @@ function.")
(:method ((class db-class))
(let ((class-name (class-name class)))
(labels
((prepare-field (field)
((ensure-list (x)
(if (listp x)
x
(list x)))
(prepare-field (field)
(list (sql-ize (slot-definition-name field))
(string-downcase (sql-type-name (or (and (foreign-type-p field) 'integer)
(slot-definition-type field))))))
(string-downcase (apply #'sql-type-name (ensure-list (or (and (foreign-type-p field) 'integer)
(slot-definition-type field)))))))
(extract-type (field)
(read-from-string (second field)))
(field= (field1 field2)
......@@ -227,4 +231,4 @@ table ~A. This may indicate that something is wrong." (first column) (second col
;;; not be misrepresented as being the original software.
;;;
;;; 3. This notice may not be removed or altered from any source
;;; distribution.
\ No newline at end of file
;;; distribution.
......@@ -56,6 +56,13 @@ metaclass set to HTML and the right connection-spec."
(defdao-example foo ()
((foo :type integer)))))
(db-test (database-consistent-with-specification :depends-on dao-definition)
(defdao-example trigram ()
((name :type (string 3) :accessor trigram-of :not-null t :initarg :trigram)
))
(finishes (with-class-connection ((find-class 'trigram))
(submarine::database-consistent-with-specification (find-class 'trigram)))))
(db-test (dao-definition-with-foreign-key :depends-on dao-definition)
(defdao-example foo ()
((foo :type integer)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment