forked from mirror/gorm
Merge branch 'otiai10-feature/id-but-not-autoincremental'
This commit is contained in:
commit
c0b9e3af82
|
@ -435,10 +435,13 @@ func (scope *Scope) generateSqlTag(field *StructField) string {
|
|||
size, _ = strconv.Atoi(value)
|
||||
}
|
||||
|
||||
_, autoIncrease := sqlSettings["AUTO_INCREMENT"]
|
||||
v, autoIncrease := sqlSettings["AUTO_INCREMENT"]
|
||||
if field.IsPrimaryKey {
|
||||
autoIncrease = true
|
||||
}
|
||||
if v == "FALSE" {
|
||||
autoIncrease = false
|
||||
}
|
||||
|
||||
sqlType = scope.Dialect().SqlTag(reflectValue, size, autoIncrease)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue