New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom type implements autoIncrement #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruanlang Sorry, I made a mistake.
- We need to support
gorm:"type:int(20) AUTO_INCREMENT"
andgorm:"type:int;autoIncrement"
, so we still need to check ifAUTO_INCREMENT
already exists. - I'm not sure what the situation here needs to recheck
TagSettings
, can you give me an example? - When we check
AUTOINCREMENT
tag, we should check the value istrue
orfalse
, refer to https://github.com/go-gorm/gorm/blob/master/schema/field.go#L113
We are used to using AUTO_INCREMENT in SQL statements, so check TagSettings["AUTO_INCREMENT"] @a631807682 |
@a631807682 Sorry, use autoIncrement by convention, specifies column auto incrementable |
@ruanlang as the first item of the last review said, you also need to check if
|
User Case Description
ID int64
gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement:true" json:"id"
go-gorm/gorm#5505 @jinzhu @a631807682