I'm planning to use GORM with an existing database, therefore I'm creating some models for it. However, I've got one problem - GORM automatically renames all column to lower snake case. I don't really need it, because the database I work with doesn't really use such names. I've found out, that I can use tag
`gorm:"column_name:`
In order to prevent my columns from being renamed. However, it doesn't really seem to be a viable solution for me, because I have a bunch of models with tons of columns. Is there any way to switch off this "renaming" policy from GORM, or to automatically add a tag to all of my models?
My models look like that:
type FOOD_DES struct {
NDB_NO string `gorm:"primary_key"`
FdGrp_Cd FD_GROUP
Long_Desc string
Shrt_Desc string
ComName string
ManufacName string
Survey string
Ref_desc string
Refuse float32
SciName string
N_Factor float32
Pro_Factor float32
Fat_Factor float32
CHO_Factor float32
}