Fix postgres primary key sql tag

This commit is contained in:
Jinzhu 2013-12-06 08:19:40 +08:00
parent e6a2273114
commit 1e6be1646e
1 changed files with 2 additions and 2 deletions

View File

@ -45,9 +45,9 @@ func (d *postgres) SqlTag(column interface{}, size int) string {
func (s *postgres) PrimaryKeyTag(column interface{}, size int) string { func (s *postgres) PrimaryKeyTag(column interface{}, size int) string {
switch column.(type) { switch column.(type) {
case int, int8, int16, int32, uint, uint8, uint16, uint32: case int, int8, int16, int32, uint, uint8, uint16, uint32:
return "serial" return "serial PRIMARY KEY"
case int64, uint64: case int64, uint64:
return "bigserial" return "bigserial PRIMARY KEY"
default: default:
panic("Invalid primary key type") panic("Invalid primary key type")
} }