author is now on separate table
This commit is contained in:
9
internal/model/author.go
Normal file
9
internal/model/author.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type Author struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
Description string
|
||||
}
|
||||
@@ -6,8 +6,9 @@ type Book struct {
|
||||
gorm.Model
|
||||
Title string `json:"title" gorm:"not null"`
|
||||
ISBN string `json:"isbn"`
|
||||
Author string `json:"author"`
|
||||
Summary string `json:"summary"`
|
||||
Author Author
|
||||
AuthorID uint
|
||||
AddedBy User
|
||||
AddedByID uint
|
||||
Cover StaticFile
|
||||
|
||||
Reference in New Issue
Block a user