Private
Public Access
sacamos referencia a empresa en la tbla de log y añado timestamps a los
repuestos
This commit is contained in:
1 parent
e4542e48e6
commit
7a68737be8
2 files changed
+11
-1
No files matched your search
@@ -20,7 +20,7 @@ type Log struct {
|
||||
Accion string `gorm:"type:varchar(50);not null" json:"accion"`
|
||||
Detalles []LogDetalle `gorm:"type:json" json:"detalles,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Empresa models_seguridad.Empresa `gorm:"foreignKey:EmpresaID" json:"empresa,omitempty"`
|
||||
// Empresa models_seguridad.Empresa `gorm:"foreignKey:EmpresaID" json:"empresa,omitempty"`
|
||||
Usuario models_seguridad.Usuario `gorm:"foreignKey:UsuarioID" json:"usuario,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
type Repuesto struct {
|
||||
ID uint64 `gorm:"primaryKey" json:"id"`
|
||||
@@ -10,7 +16,11 @@ type Repuesto struct {
|
||||
MarcaID string `gorm:"type:varchar(3);index" json:"marcaId"`
|
||||
Aliases []string `gorm:"type:json" json:"aliases,omitempty"`
|
||||
Stocks []Stock `gorm:"foreignKey:RepuestoID" json:"stocks,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (Repuesto) TableName() string {
|
||||
return "repuesto"
|
||||
}
|
||||
Reference in new issue
Block a user