From 976e4c1c1dde2da63ca713b1231733bccf4b82a3 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 31 Jan 2018 22:49:10 +0100 Subject: [PATCH] Fix SQLite processing of columns with a sequence attached. The handling of the SQLite catalogs where fixed in a previous patch, but either it's been broken in between or it never actually worked (oops). Moreover, the recent patch about :on-update-current-timestamp changed the casting rules matching code and we should position :auto-increment from the SQLite module rather than "auto_increment" as before. That's better, but wasn't done. Fix #563 again, tested with a provided test-case (thanks!). --- src/sources/sqlite/sqlite-schema.lisp | 4 ++-- src/sources/sqlite/sqlite.lisp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sources/sqlite/sqlite-schema.lisp b/src/sources/sqlite/sqlite-schema.lisp index 32af50e..15d7d84 100644 --- a/src/sources/sqlite/sqlite-schema.lisp +++ b/src/sources/sqlite/sqlite-schema.lisp @@ -100,9 +100,9 @@ (seq (sqlite:execute-single db sql))) (when (and seq (not (zerop seq))) ;; magic marker for `apply-casting-rules' - (log-message :notice "Auto Increment found at ~a.~a" + (log-message :notice "SQLite column ~a.~a uses a sequence" table-name name) - (setf (coldef-extra field) "auto_increment")))) + (setf (coldef-extra field) :auto-increment)))) (add-field table field))))) (defun list-all-columns (schema diff --git a/src/sources/sqlite/sqlite.lisp b/src/sources/sqlite/sqlite.lisp index 44fa4fc..f6803ab 100644 --- a/src/sources/sqlite/sqlite.lisp +++ b/src/sources/sqlite/sqlite.lisp @@ -116,7 +116,8 @@ (list-all-columns schema :db *sqlite-db* :including including - :excluding excluding) + :excluding excluding + :db-has-sequences (has-sequences conn)) (when create-indexes (list-all-indexes schema :db *sqlite-db*))