Files
bj_power/bj_power_wms/ent/migrate/schema.go
T
SunYF b6799c9de4 feat: 完成产线与仓储系统多模块迭代升级
本次迭代覆盖MES与WMS核心业务:
1. 新增接驳台托盘传感器读取与AGV对接能力
2. 完善工单排产、备料流程与权限体系拆分
3. 优化看板接口与前端路由、样式
4. 新增操作日志、库存盘点与角色保护逻辑
5. 修复代理地址、BOM保存等已知问题
2026-09-04 14:18:53 +08:00

690 lines
26 KiB
Go

// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// AgvTasksColumns holds the columns for the "agv_tasks" table.
AgvTasksColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "task_no", Type: field.TypeString, Unique: true, Size: 64},
{Name: "hik_task_code", Type: field.TypeString, Size: 64, Default: ""},
{Name: "source_dock", Type: field.TypeString, Size: 20, Default: ""},
{Name: "target_dock", Type: field.TypeString, Size: 20, Default: ""},
{Name: "materials_json", Type: field.TypeString, Size: 4000, Default: ""},
{Name: "related_outbound_no", Type: field.TypeString, Nullable: true, Size: 64, Default: ""},
{Name: "status", Type: field.TypeString, Size: 20, Default: "PENDING"},
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "dispatched_at", Type: field.TypeInt64, Default: 0},
{Name: "arrived_at", Type: field.TypeInt64, Default: 0},
{Name: "remark", Type: field.TypeString, Nullable: true, Size: 500, Default: ""},
{Name: "created_at", Type: field.TypeInt64},
}
// AgvTasksTable holds the schema information for the "agv_tasks" table.
AgvTasksTable = &schema.Table{
Name: "agv_tasks",
Columns: AgvTasksColumns,
PrimaryKey: []*schema.Column{AgvTasksColumns[0]},
Indexes: []*schema.Index{
{
Name: "agvtask_task_no",
Unique: true,
Columns: []*schema.Column{AgvTasksColumns[1]},
},
{
Name: "agvtask_target_dock",
Unique: false,
Columns: []*schema.Column{AgvTasksColumns[4]},
},
{
Name: "agvtask_status",
Unique: false,
Columns: []*schema.Column{AgvTasksColumns[7]},
},
{
Name: "agvtask_hik_task_code",
Unique: false,
Columns: []*schema.Column{AgvTasksColumns[2]},
},
},
}
// DocksColumns holds the columns for the "docks" table.
DocksColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "dock_code", Type: field.TypeString, Unique: true, Size: 20},
{Name: "name", Type: field.TypeString, Size: 64, Default: ""},
{Name: "dock_type", Type: field.TypeString, Size: 16, Default: "line"},
{Name: "station_no", Type: field.TypeInt, Default: 0},
{Name: "has_pallet", Type: field.TypeBool, Default: false},
{Name: "pallet_ref", Type: field.TypeString, Nullable: true, Size: 64, Default: ""},
{Name: "status", Type: field.TypeString, Size: 20, Default: "ENABLED"},
{Name: "created_at", Type: field.TypeInt64},
}
// DocksTable holds the schema information for the "docks" table.
DocksTable = &schema.Table{
Name: "docks",
Columns: DocksColumns,
PrimaryKey: []*schema.Column{DocksColumns[0]},
Indexes: []*schema.Index{
{
Name: "dock_dock_code",
Unique: true,
Columns: []*schema.Column{DocksColumns[1]},
},
{
Name: "dock_dock_type",
Unique: false,
Columns: []*schema.Column{DocksColumns[3]},
},
},
}
// EventLogColumns holds the columns for the "event_log" table.
EventLogColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "event_type", Type: field.TypeString, Size: 64},
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "entity_type", Type: field.TypeString, Size: 32, Default: ""},
{Name: "entity_id", Type: field.TypeString, Size: 64, Default: ""},
{Name: "description", Type: field.TypeString, Size: 2147483647, Default: ""},
{Name: "payload", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
{Name: "created_at", Type: field.TypeInt64},
}
// EventLogTable holds the schema information for the "event_log" table.
EventLogTable = &schema.Table{
Name: "event_log",
Columns: EventLogColumns,
PrimaryKey: []*schema.Column{EventLogColumns[0]},
Indexes: []*schema.Index{
{
Name: "eventlog_event_type",
Unique: false,
Columns: []*schema.Column{EventLogColumns[1]},
},
{
Name: "eventlog_operator",
Unique: false,
Columns: []*schema.Column{EventLogColumns[2]},
},
{
Name: "eventlog_created_at",
Unique: false,
Columns: []*schema.Column{EventLogColumns[7]},
},
},
}
// InboundDetailsColumns holds the columns for the "inbound_details" table.
InboundDetailsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "inbound_no", Type: field.TypeString},
{Name: "sn_code", Type: field.TypeString, Nullable: true},
{Name: "batch_no", Type: field.TypeString, Nullable: true},
{Name: "material_code", Type: field.TypeString},
{Name: "quantity", Type: field.TypeInt, Default: 1},
{Name: "created_at", Type: field.TypeInt64},
}
// InboundDetailsTable holds the schema information for the "inbound_details" table.
InboundDetailsTable = &schema.Table{
Name: "inbound_details",
Columns: InboundDetailsColumns,
PrimaryKey: []*schema.Column{InboundDetailsColumns[0]},
Indexes: []*schema.Index{
{
Name: "inbounddetail_inbound_no",
Unique: false,
Columns: []*schema.Column{InboundDetailsColumns[1]},
},
{
Name: "inbounddetail_sn_code",
Unique: false,
Columns: []*schema.Column{InboundDetailsColumns[2]},
},
},
}
// InboundOrdersColumns holds the columns for the "inbound_orders" table.
InboundOrdersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "inbound_no", Type: field.TypeString, Unique: true},
{Name: "inbound_type", Type: field.TypeString, Default: "purchase"},
{Name: "material_code", Type: field.TypeString},
{Name: "material_name", Type: field.TypeString, Nullable: true},
{Name: "manage_mode", Type: field.TypeInt, Default: 1},
{Name: "batch_no", Type: field.TypeString, Nullable: true},
{Name: "zone_code", Type: field.TypeString, Nullable: true},
{Name: "quantity", Type: field.TypeInt, Default: 0},
{Name: "operator", Type: field.TypeString, Nullable: true},
{Name: "remark", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
}
// InboundOrdersTable holds the schema information for the "inbound_orders" table.
InboundOrdersTable = &schema.Table{
Name: "inbound_orders",
Columns: InboundOrdersColumns,
PrimaryKey: []*schema.Column{InboundOrdersColumns[0]},
Indexes: []*schema.Index{
{
Name: "inboundorder_material_code",
Unique: false,
Columns: []*schema.Column{InboundOrdersColumns[3]},
},
{
Name: "inboundorder_inbound_type",
Unique: false,
Columns: []*schema.Column{InboundOrdersColumns[2]},
},
{
Name: "inboundorder_operator",
Unique: false,
Columns: []*schema.Column{InboundOrdersColumns[9]},
},
},
}
// InspectionRecordsColumns holds the columns for the "inspection_records" table.
InspectionRecordsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "target_type", Type: field.TypeString},
{Name: "target_id", Type: field.TypeString},
{Name: "material_code", Type: field.TypeString},
{Name: "inspection_type", Type: field.TypeString, Default: "incoming"},
{Name: "status", Type: field.TypeString, Default: "未检"},
{Name: "result_value", Type: field.TypeString, Nullable: true},
{Name: "inspect_qty", Type: field.TypeInt, Default: 0},
{Name: "pass_qty", Type: field.TypeInt, Default: 0},
{Name: "check_desc", Type: field.TypeString, Nullable: true},
{Name: "fail_reason", Type: field.TypeString, Nullable: true},
{Name: "inspector", Type: field.TypeString, Nullable: true},
{Name: "remark", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// InspectionRecordsTable holds the schema information for the "inspection_records" table.
InspectionRecordsTable = &schema.Table{
Name: "inspection_records",
Columns: InspectionRecordsColumns,
PrimaryKey: []*schema.Column{InspectionRecordsColumns[0]},
Indexes: []*schema.Index{
{
Name: "inspectionrecord_target_id",
Unique: false,
Columns: []*schema.Column{InspectionRecordsColumns[2]},
},
{
Name: "inspectionrecord_material_code",
Unique: false,
Columns: []*schema.Column{InspectionRecordsColumns[3]},
},
{
Name: "inspectionrecord_inspection_type",
Unique: false,
Columns: []*schema.Column{InspectionRecordsColumns[4]},
},
{
Name: "inspectionrecord_status",
Unique: false,
Columns: []*schema.Column{InspectionRecordsColumns[5]},
},
},
}
// InventoriesColumns holds the columns for the "inventories" table.
InventoriesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "manage_mode", Type: field.TypeInt},
{Name: "material_code", Type: field.TypeString},
{Name: "material_name", Type: field.TypeString, Nullable: true},
{Name: "batch_no", Type: field.TypeString, Nullable: true},
{Name: "sn_code", Type: field.TypeString, Nullable: true},
{Name: "quantity", Type: field.TypeInt, Default: 0},
{Name: "locked_qty", Type: field.TypeInt, Default: 0},
{Name: "quality_status", Type: field.TypeString, Default: "未检"},
{Name: "zone_code", Type: field.TypeString, Nullable: true},
{Name: "status", Type: field.TypeString, Default: "在库"},
{Name: "production_date", Type: field.TypeString, Nullable: true},
{Name: "supplier", Type: field.TypeString, Nullable: true},
{Name: "inbound_no", Type: field.TypeString, Nullable: true},
{Name: "remark", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// InventoriesTable holds the schema information for the "inventories" table.
InventoriesTable = &schema.Table{
Name: "inventories",
Columns: InventoriesColumns,
PrimaryKey: []*schema.Column{InventoriesColumns[0]},
Indexes: []*schema.Index{
{
Name: "inventory_manage_mode",
Unique: false,
Columns: []*schema.Column{InventoriesColumns[1]},
},
{
Name: "inventory_material_code",
Unique: false,
Columns: []*schema.Column{InventoriesColumns[2]},
},
{
Name: "inventory_quality_status",
Unique: false,
Columns: []*schema.Column{InventoriesColumns[8]},
},
{
Name: "inventory_zone_code",
Unique: false,
Columns: []*schema.Column{InventoriesColumns[9]},
},
{
Name: "inventory_batch_no",
Unique: false,
Columns: []*schema.Column{InventoriesColumns[4]},
},
{
Name: "inventory_sn_code",
Unique: false,
Columns: []*schema.Column{InventoriesColumns[5]},
},
},
}
// InventoryLocksColumns holds the columns for the "inventory_locks" table.
InventoryLocksColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "target_type", Type: field.TypeString},
{Name: "target_id", Type: field.TypeString},
{Name: "material_code", Type: field.TypeString},
{Name: "locked_qty", Type: field.TypeInt, Default: 1},
{Name: "order_no", Type: field.TypeString},
{Name: "status", Type: field.TypeString, Default: "ACTIVE"},
{Name: "expired_at", Type: field.TypeInt64, Nullable: true},
{Name: "remark", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// InventoryLocksTable holds the schema information for the "inventory_locks" table.
InventoryLocksTable = &schema.Table{
Name: "inventory_locks",
Columns: InventoryLocksColumns,
PrimaryKey: []*schema.Column{InventoryLocksColumns[0]},
Indexes: []*schema.Index{
{
Name: "inventorylock_order_no",
Unique: false,
Columns: []*schema.Column{InventoryLocksColumns[5]},
},
{
Name: "inventorylock_status",
Unique: false,
Columns: []*schema.Column{InventoryLocksColumns[6]},
},
{
Name: "inventorylock_target_id",
Unique: false,
Columns: []*schema.Column{InventoryLocksColumns[2]},
},
},
}
// MaterialsColumns holds the columns for the "materials" table.
MaterialsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "code", Type: field.TypeString, Unique: true},
{Name: "name", Type: field.TypeString},
{Name: "short_name", Type: field.TypeString, Nullable: true},
{Name: "spec", Type: field.TypeString, Nullable: true},
{Name: "unit", Type: field.TypeString, Nullable: true},
{Name: "description", Type: field.TypeString, Nullable: true},
{Name: "manage_mode", Type: field.TypeInt, Default: 1},
{Name: "is_batch_managed", Type: field.TypeBool, Default: false},
{Name: "is_serial_managed", Type: field.TypeBool, Default: false},
{Name: "template_code", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// MaterialsTable holds the schema information for the "materials" table.
MaterialsTable = &schema.Table{
Name: "materials",
Columns: MaterialsColumns,
PrimaryKey: []*schema.Column{MaterialsColumns[0]},
Indexes: []*schema.Index{
{
Name: "material_name",
Unique: false,
Columns: []*schema.Column{MaterialsColumns[2]},
},
{
Name: "material_template_code",
Unique: false,
Columns: []*schema.Column{MaterialsColumns[10]},
},
},
}
// OrderMaterialLedgersColumns holds the columns for the "order_material_ledgers" table.
OrderMaterialLedgersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "order_no", Type: field.TypeString},
{Name: "material_code", Type: field.TypeString},
{Name: "material_name", Type: field.TypeString, Nullable: true},
{Name: "total_qty", Type: field.TypeInt, Default: 0},
{Name: "out_qty", Type: field.TypeInt, Default: 0},
{Name: "status", Type: field.TypeString, Default: "进行中"},
{Name: "remark", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// OrderMaterialLedgersTable holds the schema information for the "order_material_ledgers" table.
OrderMaterialLedgersTable = &schema.Table{
Name: "order_material_ledgers",
Columns: OrderMaterialLedgersColumns,
PrimaryKey: []*schema.Column{OrderMaterialLedgersColumns[0]},
Indexes: []*schema.Index{
{
Name: "ordermaterialledger_order_no",
Unique: false,
Columns: []*schema.Column{OrderMaterialLedgersColumns[1]},
},
{
Name: "ordermaterialledger_material_code",
Unique: false,
Columns: []*schema.Column{OrderMaterialLedgersColumns[2]},
},
},
}
// OutboundDetailsColumns holds the columns for the "outbound_details" table.
OutboundDetailsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "outbound_no", Type: field.TypeString},
{Name: "sn_code", Type: field.TypeString, Nullable: true},
{Name: "batch_no", Type: field.TypeString, Nullable: true},
{Name: "material_code", Type: field.TypeString},
{Name: "quantity", Type: field.TypeInt, Default: 1},
{Name: "order_no", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
}
// OutboundDetailsTable holds the schema information for the "outbound_details" table.
OutboundDetailsTable = &schema.Table{
Name: "outbound_details",
Columns: OutboundDetailsColumns,
PrimaryKey: []*schema.Column{OutboundDetailsColumns[0]},
Indexes: []*schema.Index{
{
Name: "outbounddetail_outbound_no",
Unique: false,
Columns: []*schema.Column{OutboundDetailsColumns[1]},
},
{
Name: "outbounddetail_sn_code",
Unique: false,
Columns: []*schema.Column{OutboundDetailsColumns[2]},
},
{
Name: "outbounddetail_order_no",
Unique: false,
Columns: []*schema.Column{OutboundDetailsColumns[6]},
},
},
}
// OutboundOrdersColumns holds the columns for the "outbound_orders" table.
OutboundOrdersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "outbound_no", Type: field.TypeString, Unique: true},
{Name: "outbound_type", Type: field.TypeString, Default: "workorder"},
{Name: "order_no", Type: field.TypeString, Nullable: true},
{Name: "material_code", Type: field.TypeString},
{Name: "material_name", Type: field.TypeString, Nullable: true},
{Name: "manage_mode", Type: field.TypeInt, Default: 1},
{Name: "batch_no", Type: field.TypeString, Nullable: true},
{Name: "zone_code", Type: field.TypeString, Nullable: true},
{Name: "quantity", Type: field.TypeInt, Default: 0},
{Name: "operator", Type: field.TypeString, Nullable: true},
{Name: "reviewer", Type: field.TypeString, Nullable: true},
{Name: "target_dock", Type: field.TypeString, Nullable: true},
{Name: "remark", Type: field.TypeString, Nullable: true},
{Name: "box_no", Type: field.TypeString, Nullable: true},
{Name: "box_sn_list", Type: field.TypeString, Nullable: true},
{Name: "contract_no", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
}
// OutboundOrdersTable holds the schema information for the "outbound_orders" table.
OutboundOrdersTable = &schema.Table{
Name: "outbound_orders",
Columns: OutboundOrdersColumns,
PrimaryKey: []*schema.Column{OutboundOrdersColumns[0]},
Indexes: []*schema.Index{
{
Name: "outboundorder_order_no",
Unique: false,
Columns: []*schema.Column{OutboundOrdersColumns[3]},
},
{
Name: "outboundorder_material_code",
Unique: false,
Columns: []*schema.Column{OutboundOrdersColumns[4]},
},
{
Name: "outboundorder_outbound_type",
Unique: false,
Columns: []*schema.Column{OutboundOrdersColumns[2]},
},
{
Name: "outboundorder_box_no",
Unique: false,
Columns: []*schema.Column{OutboundOrdersColumns[14]},
},
},
}
// PermissionsColumns holds the columns for the "permissions" table.
PermissionsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "code", Type: field.TypeString, Unique: true, Size: 64},
{Name: "name", Type: field.TypeString, Size: 64},
{Name: "type", Type: field.TypeString, Size: 20, Default: "MENU"},
{Name: "parent_code", Type: field.TypeString, Nullable: true, Size: 64, Default: ""},
{Name: "path", Type: field.TypeString, Nullable: true, Size: 128, Default: ""},
{Name: "icon", Type: field.TypeString, Nullable: true, Size: 64, Default: ""},
{Name: "sort", Type: field.TypeInt, Nullable: true, Default: 0},
{Name: "remark", Type: field.TypeString, Nullable: true, Size: 255, Default: ""},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// PermissionsTable holds the schema information for the "permissions" table.
PermissionsTable = &schema.Table{
Name: "permissions",
Columns: PermissionsColumns,
PrimaryKey: []*schema.Column{PermissionsColumns[0]},
Indexes: []*schema.Index{
{
Name: "permission_code",
Unique: true,
Columns: []*schema.Column{PermissionsColumns[1]},
},
},
}
// RolesColumns holds the columns for the "roles" table.
RolesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "name", Type: field.TypeString, Size: 64},
{Name: "code", Type: field.TypeString, Unique: true, Size: 64},
{Name: "remark", Type: field.TypeString, Nullable: true, Size: 255, Default: ""},
{Name: "permission_codes", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// RolesTable holds the schema information for the "roles" table.
RolesTable = &schema.Table{
Name: "roles",
Columns: RolesColumns,
PrimaryKey: []*schema.Column{RolesColumns[0]},
Indexes: []*schema.Index{
{
Name: "role_code",
Unique: true,
Columns: []*schema.Column{RolesColumns[2]},
},
},
}
// SemiFinishedsColumns holds the columns for the "semi_finisheds" table.
SemiFinishedsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "sn", Type: field.TypeString, Unique: true},
{Name: "material_code", Type: field.TypeString, Nullable: true},
{Name: "completed_process", Type: field.TypeString, Nullable: true},
{Name: "quantity", Type: field.TypeInt, Default: 1},
{Name: "zone_code", Type: field.TypeString, Nullable: true},
{Name: "status", Type: field.TypeString, Default: "在库"},
{Name: "order_no", Type: field.TypeString, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// SemiFinishedsTable holds the schema information for the "semi_finisheds" table.
SemiFinishedsTable = &schema.Table{
Name: "semi_finisheds",
Columns: SemiFinishedsColumns,
PrimaryKey: []*schema.Column{SemiFinishedsColumns[0]},
Indexes: []*schema.Index{
{
Name: "semifinished_material_code",
Unique: false,
Columns: []*schema.Column{SemiFinishedsColumns[2]},
},
{
Name: "semifinished_status",
Unique: false,
Columns: []*schema.Column{SemiFinishedsColumns[6]},
},
},
}
// StocktakeItemsColumns holds the columns for the "stocktake_items" table.
StocktakeItemsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "stocktake_no", Type: field.TypeString},
{Name: "target_type", Type: field.TypeString},
{Name: "target_id", Type: field.TypeString},
{Name: "material_code", Type: field.TypeString, Nullable: true},
{Name: "zone_code", Type: field.TypeString, Nullable: true},
{Name: "book_qty", Type: field.TypeInt, Default: 0},
{Name: "scanned_qty", Type: field.TypeInt, Default: -1},
{Name: "diff_qty", Type: field.TypeInt, Default: 0},
{Name: "counted", Type: field.TypeBool, Default: false},
{Name: "updated_at", Type: field.TypeInt64},
}
// StocktakeItemsTable holds the schema information for the "stocktake_items" table.
StocktakeItemsTable = &schema.Table{
Name: "stocktake_items",
Columns: StocktakeItemsColumns,
PrimaryKey: []*schema.Column{StocktakeItemsColumns[0]},
Indexes: []*schema.Index{
{
Name: "stocktakeitem_stocktake_no",
Unique: false,
Columns: []*schema.Column{StocktakeItemsColumns[1]},
},
{
Name: "stocktakeitem_target_id",
Unique: false,
Columns: []*schema.Column{StocktakeItemsColumns[3]},
},
},
}
// StocktakeOrdersColumns holds the columns for the "stocktake_orders" table.
StocktakeOrdersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "stocktake_no", Type: field.TypeString, Unique: true},
{Name: "status", Type: field.TypeString, Default: "进行中"},
{Name: "operator", Type: field.TypeString, Nullable: true},
{Name: "total_targets", Type: field.TypeInt, Default: 0},
{Name: "created_at", Type: field.TypeInt64},
{Name: "finished_at", Type: field.TypeInt64, Nullable: true},
}
// StocktakeOrdersTable holds the schema information for the "stocktake_orders" table.
StocktakeOrdersTable = &schema.Table{
Name: "stocktake_orders",
Columns: StocktakeOrdersColumns,
PrimaryKey: []*schema.Column{StocktakeOrdersColumns[0]},
Indexes: []*schema.Index{
{
Name: "stocktakeorder_status",
Unique: false,
Columns: []*schema.Column{StocktakeOrdersColumns[2]},
},
},
}
// UsersColumns holds the columns for the "users" table.
UsersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "username", Type: field.TypeString, Unique: true},
{Name: "password", Type: field.TypeString},
{Name: "real_name", Type: field.TypeString, Nullable: true},
{Name: "role", Type: field.TypeString, Default: "operator"},
{Name: "role_id", Type: field.TypeInt, Nullable: true},
{Name: "dept", Type: field.TypeString, Nullable: true},
{Name: "phone", Type: field.TypeString, Nullable: true},
{Name: "is_active", Type: field.TypeBool, Default: true},
{Name: "last_login_at", Type: field.TypeInt64, Nullable: true},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
// UsersTable holds the schema information for the "users" table.
UsersTable = &schema.Table{
Name: "users",
Columns: UsersColumns,
PrimaryKey: []*schema.Column{UsersColumns[0]},
Indexes: []*schema.Index{
{
Name: "user_role",
Unique: false,
Columns: []*schema.Column{UsersColumns[4]},
},
},
}
// ZonesColumns holds the columns for the "zones" table.
ZonesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "zone_code", Type: field.TypeString, Unique: true},
{Name: "zone_name", Type: field.TypeString},
{Name: "description", Type: field.TypeString, Nullable: true},
{Name: "status", Type: field.TypeString, Default: "启用"},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64, Nullable: true},
}
// ZonesTable holds the schema information for the "zones" table.
ZonesTable = &schema.Table{
Name: "zones",
Columns: ZonesColumns,
PrimaryKey: []*schema.Column{ZonesColumns[0]},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
AgvTasksTable,
DocksTable,
EventLogTable,
InboundDetailsTable,
InboundOrdersTable,
InspectionRecordsTable,
InventoriesTable,
InventoryLocksTable,
MaterialsTable,
OrderMaterialLedgersTable,
OutboundDetailsTable,
OutboundOrdersTable,
PermissionsTable,
RolesTable,
SemiFinishedsTable,
StocktakeItemsTable,
StocktakeOrdersTable,
UsersTable,
ZonesTable,
}
)
func init() {
EventLogTable.Annotation = &entsql.Annotation{
Table: "event_log",
}
PermissionsTable.Annotation = &entsql.Annotation{
Table: "permissions",
}
RolesTable.Annotation = &entsql.Annotation{
Table: "roles",
}
}