From b5b6cb51e844814bc6e0c5bcf5b42a3264641517 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 13 Mar 2020 20:30:09 +0800 Subject: [PATCH] Fix postgres --- dialects/postgres.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dialects/postgres.go b/dialects/postgres.go index 2111f195..6fd9e64a 100644 --- a/dialects/postgres.go +++ b/dialects/postgres.go @@ -1071,6 +1071,8 @@ WHERE c.relkind = 'r'::char AND c.relname = $1%s AND f.attnum > 0 ORDER BY f.att col.DefaultIsEmpty = false if strings.HasPrefix(col.Default, "nextval(") { col.IsAutoIncrement = true + col.Default = "" + col.DefaultIsEmpty = true } } else { col.DefaultIsEmpty = true