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
@@ -1,12 +1,13 @@
|
||||
package models
|
||||
|
||||
|
||||
type Factura struct {
|
||||
Comprobante
|
||||
ClienteID uint `gorm:"column:ClienteID"`
|
||||
Cliente Cliente `gorm:"foreignKey:ClienteID" json:"cliente"`
|
||||
SeAviso bool `gorm:"" json:"seAviso"`
|
||||
Detalles []FacturaDetalle `gorm:"type:json" json:"detalles,omitempty"`
|
||||
ClienteID uint `gorm:"column:ClienteID"`
|
||||
Cliente Cliente `gorm:"foreignKey:ClienteID" json:"cliente"`
|
||||
ProveedorID *uint `json:"proveedorId,omitempty"`
|
||||
Proveedor *Proveedor `gorm:"foreignKey:ProveedorID" json:"proveedor,omitempty"`
|
||||
SeAviso bool `gorm:"" json:"seAviso"`
|
||||
Detalles []FacturaDetalle `gorm:"type:json" json:"detalles,omitempty"`
|
||||
}
|
||||
|
||||
func (Factura) TableName() string {
|
||||
|
||||
Reference in new issue
Block a user