changing field names
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Post struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt sql.NullTime `gorm:"index" json:"deletedAt"`
|
||||
Title string `gorm:"not null" json:"title"`
|
||||
AuthorID uint `json:"-"`
|
||||
Author *User `gorm:"foreignKey:AuthorID" json:"author"`
|
||||
Content string `json:"content"`
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
|
||||
Title string `gorm:"not null" json:"title"`
|
||||
AuthorID uint `json:"-"`
|
||||
Author *User `gorm:"foreignKey:AuthorID" json:"author"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user