1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2025-01-20 09:09:22 +02:00

сделал created_at

This commit is contained in:
Nikitin Aleksandr 2024-06-24 14:26:38 +03:00
parent 9dad8020ab
commit 1aa9dff000
3 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,5 @@
if int64(m.ID) == 0 {
m.CreatedAt = time.Now()
} else {
MassOmit = append(MassOmit, "CreatedAt")
}

View File

@ -11,7 +11,7 @@ import (
type CommonStruct struct {
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"`
ExtID int64 `json:"ext_id" gorm:"column:ext_id;default:null"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;autoCreateTime"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;autoCreateTime;<-:create;"`
ModifiedAt time.Time `json:"modified_at" gorm:"column:modified_at;autoUpdateTime"`
DeletedAt time.Time `json:"deleted_at" gorm:"column:deleted_at;default:null"`
IsDeleted bool `json:"is_deleted" gorm:"column:is_deleted;default:false"`

View File

@ -240,7 +240,7 @@ func FindTextColumn(TextModel string, Table1 *types.Table, Column1 *types.Column
TextAutoUpdateTime := ""
if config.Settings.USE_DEFAULT_TEMPLATE == true {
if ColumnNameLowerCase == "created_at" {
TextAutoCreateTime = ";autoCreateTime"
TextAutoCreateTime = ";autoCreateTime;<-:create;"
TextDefaultValue = ""
}