fix: cambiados nombres de tablas y añadido requerimiento de implementar la interfaz

This commit is contained in:
fede committed 2026-08-17 21:18:52 -03:00
1 parent cd817dcc7b
commit 59dd842d33
3 files changed
+15 -11

No files matched your search

+6 -6
View File
@@ -7,11 +7,11 @@ import (
)
type Usuario struct {
ID uint `gorm:"primaryKey" json:"id"`
Email string `gorm:"uniqueIndex;not null;type:varchar(100)" json:"email"`
Password string `gorm:"not null" json:"-"`
Name string `gorm:"not null" json:"name"`
Grupos []Grupo `gorm:"many2many:user_groups;" json:"grupos,omitempty"`
ID uint `gorm:"primaryKey" json:"id"`
Email string `gorm:"uniqueIndex;not null;type:varchar(100)" json:"email"`
Password string `gorm:"not null" json:"-"`
Name string `gorm:"not null" json:"name"`
Grupos []Grupo `gorm:"many2many:usuarios_grupos;" json:"grupos,omitempty"`
// Empresas []Empresa `gorm:"many2many:user_empresa;" json:"empresas,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
@@ -19,5 +19,5 @@ type Usuario struct {
}
func (Usuario) TableName() string {
return "users"
return "usuarios"
}