diff --git a/modelp.go b/modelp.go new file mode 100644 index 00000000..f5d9590b --- /dev/null +++ b/modelp.go @@ -0,0 +1,16 @@ +package gorm + +import "time" + +// ModelP a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt +// It may be embedded into your model or you may build your own model without it +// +// type User struct { +// gorm.ModelP +// } +type ModelP struct { + ID uint `gorm:"primarykey"` + CreatedAt *time.Time + UpdatedAt *time.Time + DeletedAt *DeletedAt `gorm:"index"` +}