From 7a68737be84fc0344f5e3bd68eafc65091ea969b Mon Sep 17 00:00:00 2001 From: fede Date: Wed, 17 Jun 2026 02:22:02 -0300 Subject: [PATCH] =?UTF-8?q?sacamos=20referencia=20a=20empresa=20en=20la=20?= =?UTF-8?q?tbla=20de=20log=20y=20a=C3=B1ado=20timestamps=20a=20los=20repue?= =?UTF-8?q?stos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/models/logs/log.go | 2 +- back/models/repuesto.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/back/models/logs/log.go b/back/models/logs/log.go index aa8fdfb..4dc7ffe 100644 --- a/back/models/logs/log.go +++ b/back/models/logs/log.go @@ -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"` } diff --git a/back/models/repuesto.go b/back/models/repuesto.go index 5d0094d..9f8f438 100644 --- a/back/models/repuesto.go +++ b/back/models/repuesto.go @@ -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" }