22 lines
455 B
Go
22 lines
455 B
Go
package schema
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"entgo.io/ent"
|
||
|
|
"entgo.io/ent/schema/field"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Zone 库房区域
|
||
|
|
// 待检/合格/不合格/退货区 等
|
||
|
|
type Zone struct {
|
||
|
|
ent.Schema
|
||
|
|
}
|
||
|
|
|
||
|
|
func (Zone) Fields() []ent.Field {
|
||
|
|
return []ent.Field{
|
||
|
|
field.String("zone_code").Unique().Comment("区域编码"),
|
||
|
|
field.String("zone_name").Comment("区域名称"),
|
||
|
|
field.String("description").Optional().Comment("描述"),
|
||
|
|
field.Int64("created_at").DefaultFunc(nowUnix),
|
||
|
|
}
|
||
|
|
}
|