Skip to content

Commit 8385c4a

Browse files
authored
feat(migrator): Add missing postgres type aliases (#312)
1 parent 84224ec commit 8385c4a

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

migrator.go

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,34 @@ WHERE
3838
`
3939

4040
var typeAliasMap = map[string][]string{
41-
"int": {"integer"},
42-
"int2": {"smallint"},
43-
"int4": {"integer"},
44-
"int8": {"bigint"},
45-
"smallint": {"int2"},
46-
"integer": {"int4"},
47-
"bigint": {"int8"},
48-
"decimal": {"numeric"},
49-
"numeric": {"decimal"},
50-
"timestamptz": {"timestamp with time zone"},
51-
"timestamp with time zone": {"timestamptz"},
52-
"bool": {"boolean"},
53-
"boolean": {"bool"},
54-
"serial2": {"smallserial"},
55-
"serial4": {"serial"},
56-
"serial8": {"bigserial"},
57-
"varbit": {"bit varying"},
58-
"char": {"character"},
59-
"varchar": {"character varying"},
60-
"float4": {"real"},
61-
"float8": {"double precision"},
62-
"timetz": {"time with time zone"},
41+
"int": {"integer"},
42+
"int2": {"smallint"},
43+
"int4": {"integer"},
44+
"int8": {"bigint"},
45+
"smallint": {"int2"},
46+
"integer": {"int4"},
47+
"bigint": {"int8"},
48+
"date": {"date"},
49+
"decimal": {"numeric"},
50+
"numeric": {"decimal"},
51+
"timestamp": {"timestamp"},
52+
"timestamptz": {"timestamp with time zone"},
53+
"timestamp without time zone": {"timestamp"},
54+
"timestamp with time zone": {"timestamptz"},
55+
"bool": {"boolean"},
56+
"boolean": {"bool"},
57+
"serial2": {"smallserial"},
58+
"serial4": {"serial"},
59+
"serial8": {"bigserial"},
60+
"varbit": {"bit varying"},
61+
"char": {"character"},
62+
"varchar": {"character varying"},
63+
"float4": {"real"},
64+
"float8": {"double precision"},
65+
"time": {"time"},
66+
"timetz": {"time with time zone"},
67+
"time without time zone": {"time"},
68+
"time with time zone": {"timetz"},
6369
}
6470

6571
type Migrator struct {

0 commit comments

Comments
 (0)