This commit is contained in:
2025-12-10 05:06:41 +00:00
parent 5ea3dc6eae
commit 4274f45849

View File

@@ -6,6 +6,6 @@ type Post struct {
gorm.Model // includes ID, CreatedAt, UpdatedAt, DeletedAt
Title string `gorm:"not null" json:"title"`
AuthorID uint `json:"-"`
Author User `gorm:"foreignKey:AuthorID" json:"author"`
Author User `gorm:"foreignKey:AuthorID;->" json:"author"`
Content string `json:"content"`
}