From 296e571e270354ad7983fbab123d69370ecbc0b0 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 22 Mar 2017 11:38:40 +0100 Subject: [PATCH] Fix MS SQL tinyint identity support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a cast rule to support tinyint being an “identity” type in MS SQL, which means using a sequence to derive its values from. We didn't address the whole MS SQL integer type tower here, and suspect we will have to add more in the future. Fix #528 where I could have access to a test case and easily reproduce the bug, thanks! --- src/sources/mssql/mssql-cast-rules.lisp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sources/mssql/mssql-cast-rules.lisp b/src/sources/mssql/mssql-cast-rules.lisp index 176f2ef..1de799e 100644 --- a/src/sources/mssql/mssql-cast-rules.lisp +++ b/src/sources/mssql/mssql-cast-rules.lisp @@ -15,6 +15,11 @@ (:source (:type "int" :auto-increment t) :target (:type "bigserial" :drop-default t)) + (:source (:type "tinyint") :target (:type "smallint")) + + (:source (:type "tinyint" :auto-increment t) + :target (:type "serial")) + (:source (:type "bit") :target (:type "boolean") :using pgloader.transforms::sql-server-bit-to-boolean) @@ -27,8 +32,6 @@ (:source (:type "geography") :target (:type "bytea") :using pgloader.transforms::byte-vector-to-bytea) - (:source (:type "tinyint") :target (:type "smallint")) - (:source (:type "float") :target (:type "float") :using pgloader.transforms::float-to-string)