Changed article author to ID only with option to preload
This commit is contained in:
@@ -2,9 +2,11 @@ package models
|
||||
|
||||
type Article struct {
|
||||
Id string `gorm:"primaryKey" json:"id"`
|
||||
Author User `json:"author"`
|
||||
AuthorId string `gorm:"index" json:"author_id"`
|
||||
Title string `json:"title"`
|
||||
Sections []ArticleSection `gorm:"serializer:json" json:"sections"`
|
||||
|
||||
Author User `gorm:"foreignKey:AuthorId" json:"author"`
|
||||
}
|
||||
|
||||
type ArticleSection struct {
|
||||
|
||||
Reference in New Issue
Block a user