Gorm: 怎么才能不自增?

Created on 28 Mar 2016  ·  1Comment  ·  Source: go-gorm/gorm

我发现我只要设了 primary_key 就是自增
如何让他是主键但不自增?

驱动pg

Most helpful comment

手动指定type 即可
//Id int64 gorm:"primary_key;not null" sql:"type:bigint(14)"

>All comments

手动指定type 即可
//Id int64 gorm:"primary_key;not null" sql:"type:bigint(14)"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bramp picture bramp  ·  3Comments

koalacxr picture koalacxr  ·  3Comments

zeropool picture zeropool  ·  3Comments

Ganitzsh picture Ganitzsh  ·  3Comments

kumarsiva07 picture kumarsiva07  ·  3Comments