From 1e6be1646ecab507f7bf39979574587a5beeaa51 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 6 Dec 2013 08:19:40 +0800 Subject: [PATCH] Fix postgres primary key sql tag --- dialect/postgres.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dialect/postgres.go b/dialect/postgres.go index fece0ff5..c0981cd0 100644 --- a/dialect/postgres.go +++ b/dialect/postgres.go @@ -45,9 +45,9 @@ func (d *postgres) SqlTag(column interface{}, size int) string { func (s *postgres) PrimaryKeyTag(column interface{}, size int) string { switch column.(type) { case int, int8, int16, int32, uint, uint8, uint16, uint32: - return "serial" + return "serial PRIMARY KEY" case int64, uint64: - return "bigserial" + return "bigserial PRIMARY KEY" default: panic("Invalid primary key type") }