go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
37.02k stars 3.94k forks source link

autoIncrementIncrement not work in postgres #7162

Open sasakiyori opened 3 months ago

sasakiyori commented 3 months ago

GORM Playground Link

https://github.com/go-gorm/playground/pull/756

Description

DB: PostgreSQL

type Book struct {
        // Whether `autoIncrementIncrement` is set or not, the increment step is always 1.
    BookID int    `gorm:"column:book_id;autoIncrement:true;autoIncrementIncrement:10"`
    Name   string `gorm:"column:name;type:varchar(255)"`
}