Private
Public Access
14 lines
516 B
Go
14 lines
516 B
Go
package models
|
|
|
|
type Almacen struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
EmpresaID uint `gorm:"not null;default:1;index;uniqueIndex:uq_almacen_empresa_codigo,priority:1" json:"empresaId"`
|
|
Codigo string `gorm:"type:varchar(5);not null;uniqueIndex:uq_almacen_empresa_codigo,priority:2" json:"codigo"`
|
|
Ubicacion string `gorm:"type:varchar(40)" json:"ubicacion"`
|
|
Stocks []Stock `gorm:"foreignKey:AlmacenID" json:"stocks,omitempty"`
|
|
}
|
|
|
|
func (Almacen) TableName() string {
|
|
return "almacen"
|
|
}
|