migrate ✅ 优化migrate

This commit is contained in:
linwenxiang committed 2021-04-23 14:25:31 +08:00
1 parent e40047a88e
commit 1a111f0666
49 files changed
+677 -202

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
package models
import (
"time"
"gorm.io/gorm"
)
type ControlBy struct {
CreateBy int `json:"createBy" gorm:"index;comment:创建者"`
UpdateBy int `json:"updateBy" gorm:"index;comment:更新者"`
}
type Model struct {
Id int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
}
type ModelTime struct {
CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"`
UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"`
}