mirror of https://github.com/go-gorm/gorm.git
Compatible with tag PRIMARY_KEY
This commit is contained in:
parent
a46d48ccb3
commit
e1bcca6b33
|
@ -148,6 +148,8 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field {
|
||||||
|
|
||||||
if val, ok := field.TagSettings["PRIMARYKEY"]; ok && checkTruth(val) {
|
if val, ok := field.TagSettings["PRIMARYKEY"]; ok && checkTruth(val) {
|
||||||
field.PrimaryKey = true
|
field.PrimaryKey = true
|
||||||
|
} else if val, ok := field.TagSettings["PRIMARY_KEY"]; ok && checkTruth(val) {
|
||||||
|
field.PrimaryKey = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := field.TagSettings["AUTOINCREMENT"]; ok && checkTruth(val) {
|
if val, ok := field.TagSettings["AUTOINCREMENT"]; ok && checkTruth(val) {
|
||||||
|
|
Loading…
Reference in New Issue