From 44508c9f823689904590a5c3e29aa0732754ed2d Mon Sep 17 00:00:00 2001 From: akuma06 Date: Fri, 12 May 2017 01:40:02 +0200 Subject: [PATCH] Fix comment model --- model/comment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/comment.go b/model/comment.go index d80c5398..67f31c67 100644 --- a/model/comment.go +++ b/model/comment.go @@ -13,8 +13,8 @@ type Comment struct { UpdatedAt time.Time `gorm:"column:updated_at"` DeletedAt *time.Time - Torrent *Torrent `gorm:"ForeignKey:torrent_id"` - User *User `gorm:"ForeignKey:user_id"` + Torrent *Torrent `gorm:"AssociationForeignKey:TorrentID;ForeignKey:torrent_id"` + User *User `gorm:"AssociationForeignKey:UserID;ForeignKey:user_id"` } // Returns the total size of memory recursively allocated for this struct