我有两张桌子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)我如何将剧集添加到以后已经存在的播客中?
1 回答
- 1 回答
- 0 关注
- 145 浏览
添加回答
举报
0/150
提交
取消