How do I stop gorm from complaining about
deleted_at field. I know I can plain struct without
gorm.Model but that would mean I cant add relations to user/other structs… eg I cannot declare user has one language association in User struct if I dont add
gorm.Model but if I add, it would complain about deleted_about field which of course doesnt exist. any help is really appreciated. I have tried some combination of tags eg I added DeletedAt field and give it tags 1. gorm: “-” and then I also tried json: “-” to ignore it, but still no luck
This seems very small basic but I couldnt figure sorry I am newbie in golang.
If you want to add relation to other structs like a foreign key constraint you can do this using foreign key tag in gorm. What relation do you want to add between two different structs?