diff --git a/src/monkey/mssql.lisp b/src/monkey/mssql.lisp index 096dadd..13bfea6 100644 --- a/src/monkey/mssql.lisp +++ b/src/monkey/mssql.lisp @@ -94,7 +94,7 @@ (:syb-int4 (unsigned-to-signed (mem-ref data :unsigned-int) 4)) (:syb-int8 (mem-ref data :int8)) (:syb-flt8 (mem-ref data :double)) - (:syb-datetime + ((:syb-datetime :syb-datetime4) (with-foreign-pointer (%buf +numeric-buf-sz+) (let ((count (%dbconvert %dbproc diff --git a/src/sources/mssql/mssql-cast-rules.lisp b/src/sources/mssql/mssql-cast-rules.lisp index 6c87c81..57f3d5f 100644 --- a/src/sources/mssql/mssql-cast-rules.lisp +++ b/src/sources/mssql/mssql-cast-rules.lisp @@ -59,6 +59,7 @@ (:source (:type "varbinary") :target (:type "bytea") :using pgloader.transforms::byte-vector-to-bytea) + (:source (:type "smalldatetime") :target (:type "timestamptz")) (:source (:type "datetime") :target (:type "timestamptz")) (:source (:type "datetime2") :target (:type "timestamptz"))) "Data Type Casting to migrate from MSSQL to PostgreSQL") diff --git a/src/sources/mssql/mssql-schema.lisp b/src/sources/mssql/mssql-schema.lisp index 94f9ca7..5fa87c9 100644 --- a/src/sources/mssql/mssql-schema.lisp +++ b/src/sources/mssql/mssql-schema.lisp @@ -282,9 +282,10 @@ ORDER BY KCU1.CONSTRAINT_NAME, KCU1.ORDINAL_POSITION" Mostly we just use the name, and make try to avoid parsing dates." (case (intern (string-upcase type) "KEYWORD") - (:datetime (format nil "convert(varchar, [~a], 126)" name)) - (:bigint (format nil "cast([~a] as numeric)" name)) - (t (format nil "[~a]" name)))) + (:datetime (format nil "convert(varchar, [~a], 126)" name)) + (:smalldatetime (format nil "convert(varchar, [~a], 126)" name)) + (:bigint (format nil "cast([~a] as numeric)" name)) + (t (format nil "[~a]" name)))) (defun get-column-list (columns) "Tweak how we fetch the column values to avoid parsing when possible."