Skip to content

Commit

Permalink
fix: return id which have type string after created
Browse files Browse the repository at this point in the history
  • Loading branch information
nohattee committed Jul 2, 2022
1 parent 3e6ab99 commit 231f90b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions schema/schema.go
Expand Up @@ -236,6 +236,15 @@ func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Nam
schema.FieldsWithDefaultDBValue = append(schema.FieldsWithDefaultDBValue, field)
}

field.HasDefaultValue = true
field.AutoIncrement = true
}
case String:
if _, ok := field.TagSettings["PRIMARYKEY"]; !ok {
if !field.HasDefaultValue || field.DefaultValueInterface != nil {
schema.FieldsWithDefaultDBValue = append(schema.FieldsWithDefaultDBValue, field)
}

field.HasDefaultValue = true
field.AutoIncrement = true
}
Expand Down

0 comments on commit 231f90b

Please sign in to comment.