Private
Public Access
Fix GORM foreign keys and column types in models
This commit is contained in:
1 parent
fce21846bc
commit
8d5e191d7d
21 files changed
+48
-39
No files matched your search
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
type Marca struct {
|
||||
gorm.Model
|
||||
Nombre string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"nombre"`
|
||||
Repuestos []Repuesto `gorm:"foreignKey:MarcaID" json:"repuestos"`
|
||||
Nombre string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"nombre"`
|
||||
Repuestos []Repuesto `gorm:"foreignKey:MarcaID" json:"repuestos"`
|
||||
}
|
||||
|
||||
func (Marca) TableName() string {
|
||||
|
||||
Reference in new issue
Block a user