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:
@@ -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:"-"`
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user