struct/slice fields are not relations but json fields but get generated as relations
Open
- Dominant language
- Go
- Stars
- 108
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
## GORM Playground Link
https://github.com/go-gorm/playground/pull/842
## Description
Fields with the gorm:"serializer:json" tag are incorrectly generated as relations instead of columns. The generator ignores the specified column:name tag and outputs .WithName("FieldName") (used for associations) instead of .WithColumn("db_name").
For example, JsonSlice is defined with column:json_slice, but the generated code produces field.Slice[string]{}.WithName("JsonSlice"). It should generate .WithColumn("json_slice") to correctly map to the serialized database column.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.