modified: main_dc/yalarba/api_es/internal/models/base.go

new file:   main_dc/yalarba/api_es/internal/models/update_history.go
add UpdateHistory model into easysite102.ru
This commit is contained in:
2026-01-22 04:52:38 +05:00
parent 9ee12e4c34
commit 276e94c460
2 changed files with 16 additions and 1 deletions
@@ -9,4 +9,6 @@ type Base struct {
ID uint `gorm:"primaryKey" json:"id"` ID uint `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"created_at"` CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"` UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
UpdateHistories []UpdateHistory `gorm:"polymorphic:Model;polymorphicValue:base" json:"-"` // полностью скрываем
}
@@ -0,0 +1,13 @@
package models
import (
"time"
)
type UpdateHistory struct {
ID uint `gorm:"primaryKey" json:"-"`
ModelID uint `json:"-"`
ModelType string `json:"-"`
Timestamp time.Time `json:"-"`
UpdatedBy uint `gorm:"index" json:"-"`
}