From 8fb9bd8d36ce5a47d691f5211433f30d6c8331e9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 28 Aug 2014 23:04:28 +0800 Subject: [PATCH] bug fixed for postgres dialect --- postgres_dialect.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postgres_dialect.go b/postgres_dialect.go index eec9989b..fcdd1fd1 100644 --- a/postgres_dialect.go +++ b/postgres_dialect.go @@ -197,6 +197,10 @@ WHERE c.relkind = 'r'::char AND c.relname = $1 AND f.attnum > 0 ORDER BY f.attnu } } + if colDefault != nil && strings.HasPrefix(*colDefault, "nextval(") { + col.IsAutoIncrement = true + } + col.Nullable = (isNullable == "YES") switch dataType {