我有兩張桌子type Podcast struct { Id int Title string RssUrl string `sql:"unique_index"` Episodes []Episode}type Episode struct { Id int PodcastID int Title string Url string `sql:"unique_index"` Downloaded bool}我知道如何將劇集插入新的播客中。podcast := Podcast{ Title: "My Podcast", RssUrl: "http://example.com/feed/", Url: "http://www.example.com", Episodes: []Episode{{ Title: "Episode One Point Oh!", Url: "http://www.example.com/one-point-oh", Downloaded: false, }},}db.Create(&podcast)我如何將劇集添加到以后已經(jīng)存在的播客中?
如何使用gorm將記錄插入到現(xiàn)有的有很多表中
滄海一幻覺(jué)
2021-10-18 13:56:26