Codebase list golang-github-jinzhu-gorm / upstream/1.9.16+git20211120.2.5c235b7 model.go
upstream/1.9.16+git20211120.2.5c235b7

Tree @upstream/1.9.16+git20211120.2.5c235b7 (Download .tar.gz)

model.go @upstream/1.9.16+git20211120.2.5c235b7raw · history · blame

package gorm

import "time"

// Model base model definition, including fields `ID`, `CreatedAt`, `UpdatedAt`, `DeletedAt`, which could be embedded in your models
//    type User struct {
//      gorm.Model
//    }
type Model struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
}