skip to Main Content

Postgresql – GORM Error on insert or update on table violates foreign key constraint

I have the following set of GORM models, with 2 orders of one-to-many relations: type Order struct { ID string `gorm:"column:id"` ClientID string `gorm:"primaryKey;column:client_id"` Name string `gorm:"column:name"` Albums []Album `gorm:"foreignKey:RequestClientID"` } type Album struct { AlbumID string `gorm:"primaryKey;column:album_id"` RequestClientID string…

VIEW QUESTION
Back To Top
Search