初始化2
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/index"
|
||||
)
|
||||
|
||||
// InboundDetail 入库明细(SN 逐条)
|
||||
type InboundDetail struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (InboundDetail) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.String("inbound_no").Comment("入库单号"),
|
||||
field.String("sn_code").Optional().Comment("SN(精密件)"),
|
||||
field.String("batch_no").Optional().Comment("批次号(结构件)"),
|
||||
field.String("material_code").Comment("物料编码"),
|
||||
field.Int("quantity").Default(1).Comment("数量"),
|
||||
field.Int64("created_at").DefaultFunc(nowUnix),
|
||||
}
|
||||
}
|
||||
|
||||
func (InboundDetail) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("inbound_no"),
|
||||
index.Fields("sn_code"),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user