Fix postgres type matching
This commit is contained in:
parent
f7eb852c66
commit
0a77813360
@ -73,19 +73,11 @@ func createColumn(app *app.App, tableName, columnName, columnType string) error
|
|||||||
// Given a type in Go, return the corresponding type in Postgres
|
// Given a type in Go, return the corresponding type in Postgres
|
||||||
func getPostgresType(goType string) (string, error) {
|
func getPostgresType(goType string) (string, error) {
|
||||||
switch goType {
|
switch goType {
|
||||||
case "int":
|
case "int", "int32", "uint", "uint32":
|
||||||
case "int32":
|
|
||||||
case "uint":
|
|
||||||
case "uint32":
|
|
||||||
return "integer", nil
|
return "integer", nil
|
||||||
case "int64":
|
case "int64", "uint64":
|
||||||
case "uint64":
|
|
||||||
return "bigint", nil
|
return "bigint", nil
|
||||||
case "int16":
|
case "int16", "int8", "uint16", "uint8", "byte":
|
||||||
case "int8":
|
|
||||||
case "uint16":
|
|
||||||
case "uint8":
|
|
||||||
case "byte":
|
|
||||||
return "smallint", nil
|
return "smallint", nil
|
||||||
case "string":
|
case "string":
|
||||||
return "text", nil
|
return "text", nil
|
||||||
|
Loading…
Reference in New Issue
Block a user