I just started to use Gorm and I am encountering troubles to define a model.
I have succeeded in creating a join table by following the doc example for self-referencing model:
type User struct {
gorm.Model
Friends []*User `gorm:"many2many:friendships;association_jointable_foreignkey:friend_id"`
}
The problem is I want an extra column in my join table to know whether a friend is accepted or not. I have looked for an answer through the internet but the only answer that I found is this :
https://github.com/jinzhu/gorm/issues/719#issuecomment-168485989
but I don't understand how I can adapt it in my case.
If anyone out there has any examples and/or solutions, I will be grateful.
Thanks again !