From 0a778133607dd10f069c7e326cae0307ec59be7f Mon Sep 17 00:00:00 2001 From: Maximilian Date: Fri, 17 Feb 2023 18:47:29 -0600 Subject: [PATCH] Fix postgres type matching --- database/migrate.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/database/migrate.go b/database/migrate.go index 984cdcf..73f21ae 100644 --- a/database/migrate.go +++ b/database/migrate.go @@ -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 func getPostgresType(goType string) (string, error) { switch goType { - case "int": - case "int32": - case "uint": - case "uint32": + case "int", "int32", "uint", "uint32": return "integer", nil - case "int64": - case "uint64": + case "int64", "uint64": return "bigint", nil - case "int16": - case "int8": - case "uint16": - case "uint8": - case "byte": + case "int16", "int8", "uint16", "uint8", "byte": return "smallint", nil case "string": return "text", nil