gorm/model.go

17 lines
396 B
Go
Raw Normal View History

2020-03-09 08:10:48 +03:00
package gorm
import "time"
// Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt
2020-06-09 07:00:43 +03:00
// It may be embedded into your model or you may build your own model without it
//
// type User struct {
// gorm.Model
// }
2020-03-09 08:10:48 +03:00
type Model struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
2020-05-29 02:35:45 +03:00
DeletedAt DeletedAt `gorm:"index"`
2020-03-09 08:10:48 +03:00
}