gorm/model.go

16 lines
402 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
2020-03-09 08:10:48 +03:00
// type User struct {
// gorm.Model
// }
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
}