Skip to content

Commit

Permalink
fix(config): Fix override of int16 types
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Tann committed Feb 10, 2022
1 parent ac8533e commit f459a3e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/codegen/golang/go_type.go
Expand Up @@ -32,7 +32,14 @@ func goInnerType(r *compiler.Result, col *compiler.Column, settings config.Combi
if oride.GoTypeName == "" {
continue
}
if oride.DBType != "" && oride.DBType == columnType && oride.Nullable != notNull {
match := oride.DBType == columnType
if !match && columnType == "pg_catalog.int2" {
switch oride.DBType {
case "smallint", "int2":
match = true
}
}
if oride.DBType != "" && match && oride.Nullable != notNull {
return oride.GoTypeName
}
}
Expand Down

0 comments on commit f459a3e

Please sign in to comment.