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
@@ -2,10 +2,11 @@ package models
|
||||
|
||||
type NotaCredito struct {
|
||||
Comprobante
|
||||
Motivo string `gorm:"type:varchar(40),not null"`
|
||||
FacturaOrigen Factura `gorm:"foreignKey:facturaID" json:"factura"`
|
||||
Motivo string `gorm:"type:varchar(40);not null"`
|
||||
FacturaOrigen Factura `gorm:"foreignKey:FacturaOrigenID" json:"factura"`
|
||||
FacturaOrigenID uint `gorm:"column:facturaID"`
|
||||
}
|
||||
|
||||
func (NotaCredito) TableName() string {
|
||||
return "nota_credito"
|
||||
}
|
||||
Reference in new issue
Block a user