Skip to content

Commit 296e571

Browse files
committed
Fix MS SQL tinyint identity support.
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!
1 parent 940fc63 commit 296e571

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sources/mssql/mssql-cast-rules.lisp

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
(:source (:type "int" :auto-increment t)
1616
:target (:type "bigserial" :drop-default t))
1717

18+
(:source (:type "tinyint") :target (:type "smallint"))
19+
20+
(:source (:type "tinyint" :auto-increment t)
21+
:target (:type "serial"))
22+
1823
(:source (:type "bit") :target (:type "boolean")
1924
:using pgloader.transforms::sql-server-bit-to-boolean)
2025

@@ -27,8 +32,6 @@
2732
(:source (:type "geography") :target (:type "bytea")
2833
:using pgloader.transforms::byte-vector-to-bytea)
2934

30-
(:source (:type "tinyint") :target (:type "smallint"))
31-
3235
(:source (:type "float") :target (:type "float")
3336
:using pgloader.transforms::float-to-string)
3437

0 commit comments

Comments
 (0)