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,9 +1,9 @@
|
||||
package models
|
||||
|
||||
type Almacen struct {
|
||||
ID string `gorm:"primaryKey;type:varchar(5)" json:"id"`
|
||||
Ubicacion string `gorm:"type:varchar(40)" json:"ubicacion"`
|
||||
Stocks []Stock `gorm:"foreignKey:repuestoID" json:"stocks,omitempty"`
|
||||
ID string `gorm:"primaryKey;type:varchar(5)" json:"id"`
|
||||
Ubicacion string `gorm:"type:varchar(40)" json:"ubicacion"`
|
||||
Stocks []Stock `gorm:"foreignKey:AlmacenID" json:"stocks,omitempty"`
|
||||
}
|
||||
|
||||
func (Almacen) TableName() string {
|
||||
|
||||
Reference in new issue
Block a user