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 efce89b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions schema/schema.go
Expand Up @@ -239,6 +239,14 @@ func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Nam
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
}
}
}

Expand Down

0 comments on commit efce89b

Please sign in to comment.