1234567891011121314151617181920212223242526 |
- package entity
- import (
- "time"
- )
- const TableNameBookCategory = "book_categories"
- type BookCategory struct {
- ID int64 `gorm:"column:id;type:int;primaryKey;autoIncrement:true" json:"id"`
- BookID int64 `gorm:"column:book_id;type:int;not null" json:"book_id"`
- CategoryID *int64 `gorm:"column:category_id;type:int" json:"category_id"`
- CreateAt time.Time `gorm:"column:create_at;type:timestamp;not null" json:"create_at"`
- UpdateAt time.Time `gorm:"column:update_at;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"update_at"`
- }
- func (*BookCategory) TableName() string {
- return TableNameBookCategory
- }
|