using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Business.Migrations { public partial class demoInit : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "b_bom_pretreatment", columns: table => new { Id = table.Column(type: "bigint", nullable: false), sourceid = table.Column(type: "bigint", nullable: false, comment: "所属BOM"), fid = table.Column(type: "bigint", nullable: false, comment: "本级id"), parent_id = table.Column(type: "bigint", nullable: true, comment: "父级"), bom_child_id = table.Column(type: "bigint", nullable: true, comment: "bom明细主键"), bom_number = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom编号"), item_id = table.Column(type: "bigint", nullable: true, comment: "物料id"), item_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"), model = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"), item_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编号"), level = table.Column(type: "int", nullable: false, comment: "level"), bom_id = table.Column(type: "bigint", nullable: true, comment: "BOMid"), num = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "项次号"), num_order = table.Column(type: "bigint", nullable: true, comment: "供排序使用"), type = table.Column(type: "int", nullable: false, comment: "类型"), qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位用量"), unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"), erp_cls = table.Column(type: "int", nullable: false, comment: "物料属性"), erp_cls_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料属性名称"), backflush = table.Column(type: "int", nullable: false, comment: "是否倒冲"), haveicsubs = table.Column(type: "int", nullable: false, comment: "存在替代关系"), substitute_code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"), substitute_strategy = table.Column(type: "int", nullable: false, comment: "替代策略"), substitute_mode = table.Column(type: "int", nullable: false, comment: "替代方式"), version = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_b_bom_pretreatment", x => x.Id); }, comment: "Bom预处理"); migrationBuilder.CreateTable( name: "crm_customer", columns: table => new { Id = table.Column(type: "bigint", nullable: false), customer_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户编号"), customer_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户名称"), customer_level = table.Column(type: "int", maxLength: 255, nullable: true, comment: "客户级别"), mobile = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "手机号码"), telephone = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "电话号码"), email = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮件地址"), contact = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系人"), post_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮政编码"), country = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "国别地区"), province = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "省份"), city = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "城市"), region = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "区"), address = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "地址"), sale_mode = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "销售模式"), short_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户简称"), short_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户简码"), state = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "状态"), value_add_rate = table.Column(type: "decimal(18,10)", precision: 18, scale: 10, nullable: true, comment: "增值税率"), carrying_aos = table.Column(type: "int", nullable: false, comment: "默认运输提前期_天"), corperate = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "法人代表"), currency = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算币种"), employee_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员"), employee_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号"), op_time = table.Column(type: "datetime2", nullable: true, comment: "操作时间"), cust_type_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户类别编码"), cust_type = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户类别"), cust_group_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户分组编号"), cust_group_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户分组名称"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_crm_customer", x => x.Id); }, comment: "客户"); migrationBuilder.CreateTable( name: "crm_seorder", columns: table => new { Id = table.Column(type: "bigint", nullable: false), bill_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单编号"), order_type = table.Column(type: "int", nullable: true, comment: "订单类别(销售、计划)"), trade_type = table.Column(type: "int", nullable: true, comment: "贸易类型"), sale_style = table.Column(type: "int", nullable: true, comment: "销售订单类型"), sale_style_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售订单类型编码"), custom_id = table.Column(type: "int", nullable: true, comment: "客户id"), custom_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户名称"), custom_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户编码"), custom_level = table.Column(type: "int", maxLength: 80, nullable: true, comment: "客户级别"), date = table.Column(type: "datetime2", nullable: true, comment: "签订日期"), rdate = table.Column(type: "datetime2", nullable: true, comment: "采购下单日期"), urgent = table.Column(type: "int", nullable: false, comment: "加急级别"), currency = table.Column(type: "int", maxLength: 50, nullable: true, comment: "币种"), exchange_rate = table.Column(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "汇率"), biller = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "制单人"), emp_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "业务员工号"), emp_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "业务员名称"), auditor = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "审核人"), audit_date = table.Column(type: "datetime2", nullable: true, comment: "审核日期"), status = table.Column(type: "int", nullable: true, comment: "订单状态"), closed = table.Column(type: "bit", nullable: false, comment: "是否关闭1关闭0未关闭"), op_time = table.Column(type: "datetime2", nullable: true, comment: "操作时间"), bill_from = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "订单来源"), project_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"), project_code = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目编号"), out_stock_type = table.Column(type: "int", nullable: true, comment: "销售出库类型"), sale_dept_id = table.Column(type: "bigint", nullable: true, comment: "销售部门id"), sale_dept_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售部门名称"), sale_dept_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售部门编号"), create_dept = table.Column(type: "bigint", nullable: true, comment: "创建部门id"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_crm_seorder", x => x.Id); }, comment: "销售订单表"); migrationBuilder.CreateTable( name: "crm_seorderentry", columns: table => new { Id = table.Column(type: "bigint", nullable: false), seorder_id = table.Column(type: "bigint", nullable: true, comment: "销售订单id"), bill_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "销售订单编号"), entry_seq = table.Column(type: "int", nullable: true, comment: "行号"), map_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "对应代码"), map_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "代码名称"), item_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "产品代码"), fms_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "FMS旧料号"), item_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "产品名称"), specification = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "规格型号"), urgent = table.Column(type: "int", nullable: true, comment: "加急级别"), bom_number = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "BOM编号"), unit = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "单位"), qty = table.Column(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单数量"), price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单价"), tax_price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "含税单价"), amount = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "金额"), tax_rate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"), discount_rate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "折扣率"), discount_amount = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "折扣额"), aux_price_discount = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "实际含税单价"), tax_amtount = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "销项税额"), total_amount = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "价税合计"), plan_date = table.Column(type: "datetime2", nullable: true, comment: "客户要求交期"), date = table.Column(type: "datetime2", nullable: true, comment: "最终交货日期"), planner_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "计划员"), planner_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "计划员_工号"), remark = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "备注"), soure_bill_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "源单编号"), custom_order_bill_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "客户订单号"), custom_order_entryid = table.Column(type: "int", nullable: true, comment: "客户订单行号"), sys_capacity_date = table.Column(type: "datetime2", nullable: true, comment: "系统建议交期(产能)"), adjust_date = table.Column(type: "datetime2", nullable: true, comment: "调整建议交期"), mrp_closed = table.Column(type: "bit", nullable: true, comment: "mrp关闭"), op_time = table.Column(type: "datetime2", nullable: true, comment: "操作时间"), custom_order_itemno = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户料号"), state = table.Column(type: "bit", nullable: true, comment: "数据状态标识 0停用 1启用"), rstate = table.Column(type: "int", nullable: true, comment: "评审状态"), rnumber = table.Column(type: "int", nullable: true, comment: "评审次数"), progress = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "订单进度"), deliver_notice_count = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发货通知单数量"), deliver_count = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发货数量(已出库数量)"), se_reject_reason = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "业务员工号"), out_stock_type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "出库类型"), is_checked = table.Column(type: "bit", nullable: true, comment: "是否完成检测,0未完成,1完成"), sys_material_date = table.Column(type: "datetime2", nullable: true, comment: "系统建议交期(物料)"), contract_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "合同编号"), create_dept = table.Column(type: "bigint", nullable: true, comment: "创建部门id"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_crm_seorderentry", x => x.Id); }, comment: "销售订单明细表"); migrationBuilder.CreateTable( name: "ic_bom", columns: table => new { Id = table.Column(type: "bigint", nullable: false), bom_number = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom单编号"), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料id"), item_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料代码"), item_name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"), bom_num = table.Column(type: "int", nullable: true, comment: "序号"), use_status = table.Column(type: "int", nullable: true, comment: "使用状态"), begin_day = table.Column(type: "datetime2", nullable: true, comment: "生效日期"), end_day = table.Column(type: "datetime2", nullable: true, comment: "失效日期"), product_principal = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "生产负责人"), product_designer = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品设计员"), version = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"), chartnumber = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图表编号"), biller = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图片"), checker = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "检验人"), check_date = table.Column(type: "datetime2", nullable: true, comment: "检验时间"), user = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom创建人"), use_date = table.Column(type: "datetime2", nullable: true, comment: "bom创建时间"), unit = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_bom", x => x.Id); }, comment: "物料BOM"); migrationBuilder.CreateTable( name: "ic_bom_child", columns: table => new { Id = table.Column(type: "bigint", nullable: false), bom_id = table.Column(type: "bigint", nullable: false, comment: "bom主键"), bom_number = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom单编号"), is_bom = table.Column(type: "int", nullable: true, comment: "是否是BOM"), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料id"), item_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料代码"), item_name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"), unit = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"), qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "用量"), scrap = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "损耗率"), backflush = table.Column(type: "int", nullable: true, comment: "是否倒冲"), iskeyitem = table.Column(type: "int", nullable: true, comment: "是否关键件"), haveicsubs = table.Column(type: "int", nullable: true, comment: "存在替代关系"), substitute_code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"), is_replace = table.Column(type: "int", nullable: true, comment: "是否群组替代"), icitem_ids = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合模式"), note = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"), entryid = table.Column(type: "int", nullable: true, comment: "顺序号"), type = table.Column(type: "int", nullable: true, comment: "物料类型"), erp_cls = table.Column(type: "int", nullable: true, comment: "物料属性"), use_status = table.Column(type: "int", nullable: true, comment: "使用状态"), begin_day = table.Column(type: "datetime2", nullable: true, comment: "生效日期"), end_day = table.Column(type: "datetime2", nullable: true, comment: "失效日期"), op_time = table.Column(type: "datetime2", nullable: true, comment: "操作时间"), child_num = table.Column(type: "int", nullable: true, comment: "序号"), version = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_bom_child", x => x.Id); }, comment: "物料BOM明细"); migrationBuilder.CreateTable( name: "ic_item", columns: table => new { Id = table.Column(type: "bigint", nullable: false), number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编码"), name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"), model = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"), full_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "全名"), fms_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"), erp_oldnumber = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "erp旧料号"), chart_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图号"), fversion = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本号"), box_model = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "盒贴规格"), erp_cls = table.Column(type: "int", nullable: true, comment: "物料属性"), erp_cls_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料属性"), unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"), item_level = table.Column(type: "bigint", nullable: true, comment: "物料等级"), standard_manhour = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位标准工时_小时"), unititem_amount = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位材料定额_元"), source = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "来源"), is_equipment = table.Column(type: "int", nullable: true, comment: "是否为设备"), unit_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位包装数量"), iskeyitem = table.Column(type: "int", nullable: true, comment: "是否关键件"), gross_weight = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "毛重"), net_weight = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "净重"), maund = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "重量单位"), length = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "长度"), cubic_measure = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "长度单位"), width = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "宽度"), height = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "高度"), size = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "体积"), allowpur = table.Column(type: "int", nullable: true, comment: "允许采购"), allowsale = table.Column(type: "int", nullable: true, comment: "允许销售"), allowmanu = table.Column(type: "int", nullable: true, comment: "允许生产"), allowout = table.Column(type: "int", nullable: true, comment: "允许委外"), allowbatch = table.Column(type: "int", nullable: true, comment: "批号管理"), allowserial = table.Column(type: "int", nullable: true, comment: "序列号管理"), photo = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图片"), picktype = table.Column(type: "bigint", nullable: true, comment: "领料类型"), output_type_id = table.Column(type: "bigint", nullable: true, comment: "出库类型"), enable_warning = table.Column(type: "int", nullable: true, comment: "启用预警"), life_state = table.Column(type: "int", nullable: true, comment: "生命周期状态"), moq = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "经济生产批量"), maq = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "最大生产批量"), is_clean = table.Column(type: "int", nullable: true, comment: "是否备料前预处理"), clean_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "预处理提前期"), sterilize_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工序委外提前期"), transfer_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "平台调拨提前期"), standard_period = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "标准工期"), fmr = table.Column(type: "nvarchar(max)", nullable: true, comment: "FMR分类"), abc = table.Column(type: "nvarchar(max)", nullable: true, comment: "ABC分类"), fix_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "固定提前期(天)"), plan_trategy = table.Column(type: "int", nullable: true, comment: "计划策略"), order_trategy = table.Column(type: "int", nullable: true, comment: "订货策略"), order_inter_val = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订货间隔期_天"), lead_time = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "变动提前期"), bat_change_economy = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "变动提前期批量"), total_tqq = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "累计提前期"), order_point = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "再订货点"), isfixedreorder = table.Column(type: "int", nullable: true, comment: "设置为固定再订货点"), secinv = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存数量"), secinv_ratio = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存触发采购比例"), self_inspection_date = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "自检提前期"), Warehousing_date = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库提前期"), Shipping_date = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发运提前期"), product_line = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品线"), batch_manager = table.Column(type: "int", nullable: false, comment: "是否采用业务批次管理"), ordissu_days = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单发料时间/天"), transportation_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "运输中提前期_天"), stock_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "仓库中提前期_天"), production_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "生产中提前期_天"), order_leadtime = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "下单前置期_天"), minpackqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "最小包装量"), minorderqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "最小订单量"), isbackflush = table.Column(type: "int", nullable: true, comment: "是否倒冲"), put_integer = table.Column(type: "int", nullable: true, comment: "投料自动取整"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_item", x => x.Id); }, comment: "物料详情"); migrationBuilder.CreateTable( name: "ic_item_inventory", columns: table => new { Id = table.Column(type: "bigint", nullable: false), icitem_stock_id = table.Column(type: "bigint", nullable: false, comment: "物料库存主键"), stock_id = table.Column(type: "bigint", nullable: false, comment: "仓库id"), stock_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "仓库名称"), stock_place_id = table.Column(type: "bigint", nullable: false, comment: "库位id"), stock_place_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "库位编码"), batch_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "批次号"), qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "数量"), bal = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "金额"), kf_period = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "保质期时长"), kf_date = table.Column(type: "datetime2", nullable: true, comment: "保质期时间"), qty_lock = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "锁定库存"), sec_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存"), unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"), rq = table.Column(type: "datetime2", nullable: true, comment: "日期"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_item_inventory", x => x.Id); }, comment: "物料库存明细表"); migrationBuilder.CreateTable( name: "ic_item_stock", columns: table => new { Id = table.Column(type: "bigint", nullable: false), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料id"), icitem_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"), sqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "物料库存量"), quantity_in_transit = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "调拨在途数量"), factory_fode = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工厂编码"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_item_stock", x => x.Id); }, comment: "物料库存表"); migrationBuilder.CreateTable( name: "ic_substitute", columns: table => new { Id = table.Column(type: "bigint", nullable: false), substitute_code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"), substitute_type = table.Column(type: "int", nullable: true, comment: "替代类型"), substitute_strategy = table.Column(type: "int", nullable: true, comment: "替代策略"), substitute_mode = table.Column(type: "int", nullable: true, comment: "替代方式"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_substitute", x => x.Id); }, comment: "替代群组"); migrationBuilder.CreateTable( name: "ic_substitute_group", columns: table => new { Id = table.Column(type: "bigint", nullable: false), substitute_group_id = table.Column(type: "bigint", nullable: false, comment: "群组主键"), substitute_code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"), replace_relation = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "替代关系"), replace_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "替代名称"), replace_way = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "替代方式"), product_line = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "产品线"), use_model = table.Column(type: "nvarchar(max)", maxLength: 5000, nullable: true, comment: "使用机型"), order_num = table.Column(type: "int", nullable: true, comment: "群组优先级"), main_material = table.Column(type: "int", nullable: true, comment: "主料/替代料"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_substitute_group", x => x.Id); }, comment: "物料替代多群组"); migrationBuilder.CreateTable( name: "ic_substitute_group_detail", columns: table => new { Id = table.Column(type: "bigint", nullable: false), substitute_group_id = table.Column(type: "bigint", nullable: false, comment: "替代多群组主键"), substitute_code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料主键"), icitem_number = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "物料编码"), ismain = table.Column(type: "int", nullable: true, comment: "主/替"), seq = table.Column(type: "int", nullable: true, comment: "序号"), replace_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "替代数量"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_ic_substitute_group_detail", x => x.Id); }, comment: "物料替代多群组明细"); migrationBuilder.CreateTable( name: "mes_moentry", columns: table => new { Id = table.Column(type: "bigint", nullable: false), moentry_moid = table.Column(type: "bigint", nullable: true, comment: "工单主表id"), moentry_mono = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工单编号"), soentry_id = table.Column(type: "bigint", nullable: true, comment: "订单行id"), fentry_id = table.Column(type: "bigint", nullable: true, comment: "订单行号"), fbill_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "订单编号"), unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"), morder_production_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"), need_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"), remaining_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "剩余可用数量"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_moentry", x => x.Id); }, comment: "生成工单子表"); migrationBuilder.CreateTable( name: "mes_mooccupy", columns: table => new { Id = table.Column(type: "bigint", nullable: false), moo_id_type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "类型--原始,分配"), moo_id_billid = table.Column(type: "bigint", nullable: true, comment: "订单id"), fbill_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单号"), fentry_id = table.Column(type: "bigint", nullable: true, comment: "行号"), fitem_number = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "物料编码"), fitem_name = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "物料名称"), fmodel = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"), moo_moid = table.Column(type: "bigint", nullable: true, comment: "工单id"), moo_mo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工单号"), moo_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "占用量"), moo_stime = table.Column(type: "datetime2", nullable: true, comment: "开始时间"), moo_etime = table.Column(type: "datetime2", nullable: true, comment: "结束时间"), moo_state = table.Column(type: "int", nullable: true, comment: "占用状态-1占用 默认0"), moo_cbr = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "变更人"), moo_ctime = table.Column(type: "datetime2", nullable: true, comment: "变更时间"), moo_creason = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "变更原因"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_mooccupy", x => x.Id); }, comment: "在制工单占用记录表"); migrationBuilder.CreateTable( name: "mes_morder", columns: table => new { Id = table.Column(type: "bigint", nullable: false), parent_id = table.Column(type: "bigint", nullable: true, comment: "上级工单id"), relation_moid = table.Column(type: "bigint", nullable: true, comment: "关联工单id"), relation_mono = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "关联编号"), morder_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "生产工单编号"), morder_type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单类型(类型:计划工单、销售工单、委外工单、预测工单)"), morder_icitem_type = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "工单所属物料类型"), work_order_type = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "工单类型(类型:发货工单、试产工单、备库工单、常规工单、返工工单)"), morder_date = table.Column(type: "datetime2", nullable: true, comment: "生产工单日期"), morder_state = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单状态(订单状态:初始,下达,暂停、完成)"), moentry_prd = table.Column(type: "bigint", nullable: true, comment: "生产组织id"), moentry_prdname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称"), moentry_wrkc = table.Column(type: "bigint", nullable: true, comment: "工作中心id"), moentry_wrkcname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称"), planner_num = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员工号"), planner_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员名称"), moentry_stime = table.Column(type: "datetime2", nullable: true, comment: "生产工单开始日期"), moentry_etime = table.Column(type: "datetime2", nullable: true, comment: "生产工单结束日期"), moentry_sys_stime = table.Column(type: "datetime2", nullable: true, comment: "系统建议开工时间"), moentry_sys_etime = table.Column(type: "datetime2", nullable: true, comment: "系统建议完工时间"), reality_start_time = table.Column(type: "datetime2", nullable: true, comment: "实际开始时间"), reality_end_time = table.Column(type: "datetime2", nullable: true, comment: "实际结束时间"), planner_start_date = table.Column(type: "datetime2", nullable: true, comment: "计划员设定开始时间"), planner_end_date = table.Column(type: "datetime2", nullable: true, comment: "计划员设定结束时间"), mat_start_date = table.Column(type: "datetime2", nullable: true, comment: "基于物料开始时间"), mat_end_date = table.Column(type: "datetime2", nullable: true, comment: "基于物料结束时间"), product_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品代码"), product_name = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "产品名称"), fms_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"), fmodel = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"), bom_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "bom编码"), unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"), morder_progress = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "工单进度"), morder_need_time = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单所需工时"), morder_production_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"), need_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"), remaining_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "剩余可用数量"), work_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报工数量"), inspection_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报检数量"), qualified_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "合格数量"), inventory_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库数量"), notice_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已开入库通知单数量"), moentry_startup_status = table.Column(type: "int", nullable: true, comment: "启动状态"), start_time = table.Column(type: "datetime2", nullable: true, comment: "开始时间"), pause_time = table.Column(type: "datetime2", nullable: true, comment: "最近暂停时间"), restart_time = table.Column(type: "datetime2", nullable: true, comment: "最近重启时间"), project_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"), overdue_Remark = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "逾期原因备注"), picking_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已领料数量"), morder_fstate = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "前状态--计划、下达、完成、关闭"), morder_batchno = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "工单批号--(批号管理的物料出入库要使用)"), convey_date = table.Column(type: "datetime2", nullable: true, comment: "下达日期"), urgent = table.Column(type: "int", nullable: false, comment: "加急级别"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_morder", x => x.Id); }, comment: "工单主表"); migrationBuilder.CreateTable( name: "mes_oorder", columns: table => new { Id = table.Column(type: "bigint", nullable: false), oorder_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单编号"), oorder_type = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "生产工单类型"), oorder_date = table.Column(type: "datetime2", nullable: true, comment: "委外订单日期"), oorder_state = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单状态"), ooentry_prd = table.Column(type: "bigint", nullable: true, comment: "生产组织"), ooentry_prdname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称"), ooentry_wrkc = table.Column(type: "bigint", nullable: true, comment: "工作中心id"), ooentry_wrkcname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称"), planner_num = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员工号"), planner_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员名称"), ooentry_stime = table.Column(type: "datetime2", nullable: true, comment: "计划开工日期"), ooentry_etime = table.Column(type: "datetime2", nullable: true, comment: "计划完工日期"), product_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品代码"), ffms_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"), product_name = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "产品名称"), specification_model = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"), bom_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "bom编码"), unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"), morder_progress = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "工单进度"), morder_production_number = table.Column(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"), need_number = table.Column(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "需求数量"), remaining_number = table.Column(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "剩余可用数量"), work_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报工数量"), inspection_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报检数量"), qualified_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "合格数量"), inventory_number = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库数量"), notice_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已开通知单数量"), moentry_on = table.Column(type: "int", nullable: true, comment: "启动状态"), start_time = table.Column(type: "datetime2", nullable: true, comment: "开始时间"), pause_time = table.Column(type: "datetime2", nullable: true, comment: "最近暂停时间"), restart_time = table.Column(type: "datetime2", nullable: true, comment: "最近重启时间"), project_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"), sent_status = table.Column(type: "int", nullable: true, comment: "发料状态 1-待发料 2-已发料"), production_unit = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "加工单位"), production_unit_code = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "加工单位编码"), need_icitem_status = table.Column(type: "int", nullable: true, comment: "所需物料是否充足 1-充足 0-缺料"), sentry_id = table.Column(type: "bigint", nullable: true, comment: "订单行id"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_oorder", x => x.Id); }, comment: "委外订单表"); migrationBuilder.CreateTable( name: "mes_process", columns: table => new { Id = table.Column(type: "bigint", nullable: false), proc_name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "工序名称"), short_desc = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "简述"), long_desc = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "详细描述"), subids = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合工序id"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_process", x => x.Id); }, comment: "工序表"); migrationBuilder.CreateTable( name: "mes_stockoccupy", columns: table => new { Id = table.Column(type: "bigint", nullable: false), soccupy_type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "类型"), soentry_id = table.Column(type: "bigint", nullable: true, comment: "订单行id"), fentry_id = table.Column(type: "bigint", nullable: true, comment: "订单行号"), fbill_no = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单编号"), fitem_number = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "物料编码"), fitem_name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"), fmodel = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"), warehouse_id = table.Column(type: "bigint", nullable: false, comment: "仓库id"), warehouse_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "仓库名称"), warehouse_type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "仓库类型"), occupyqty = table.Column(type: "decimal(20,2)", precision: 20, scale: 2, nullable: true, comment: "占用量"), soccupy_stime = table.Column(type: "datetime2", nullable: true, comment: "开始时间"), soccupy_etime = table.Column(type: "datetime2", nullable: true, comment: "结束时间"), soccupy_state = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "占用状态"), soccupy_cby = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "变更人"), soccupy_ctime = table.Column(type: "datetime2", nullable: true, comment: "变更时间"), soccupy_creason = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "变更原因"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_stockoccupy", x => x.Id); }, comment: "成品库存占用表"); migrationBuilder.CreateTable( name: "mes_tech_process", columns: table => new { Id = table.Column(type: "bigint", nullable: false), tech_id = table.Column(type: "bigint", nullable: false, comment: "工艺主键"), proc_id = table.Column(type: "bigint", nullable: false, comment: "工序主键"), level = table.Column(type: "int", nullable: false, comment: "组合层级"), is_schedule = table.Column(type: "int", nullable: false, comment: "是否需要排产:1-是;0-否"), readytime = table.Column(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "前置准备时间"), wctype = table.Column(type: "int", nullable: true, comment: "工作中心类型"), lq = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "前置最小数量"), lqt = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "前置等待时间"), upp = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "子工序加工数量"), upe = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "一次可加工数量"), wsinuse = table.Column(type: "int", nullable: true, comment: "实际运行工位数"), uph = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "UPH"), ct = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "节拍时间"), effect_ratio = table.Column(type: "decimal(10,4)", precision: 10, scale: 4, nullable: true, comment: "效率系数"), mototrack = table.Column(type: "int", nullable: true, comment: "是否需要跟踪工序"), nextprocid = table.Column(type: "bigint", nullable: true, comment: "下一工序id"), parentprocid = table.Column(type: "bigint", nullable: true, comment: "父级工序id"), needqc = table.Column(type: "int", nullable: true, comment: "是否需要质检"), maxworkshop = table.Column(type: "int", nullable: true, comment: "最大并行工位数"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_tech_process", x => x.Id); }, comment: "工艺关联工序表"); migrationBuilder.CreateTable( name: "mes_technique", columns: table => new { Id = table.Column(type: "bigint", nullable: false), tech_name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "工艺路径名称"), level = table.Column(type: "int", nullable: true, comment: "效率计算层级"), bom = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "产品"), bomver = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "产品版本"), desc = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "描述"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_technique", x => x.Id); }, comment: "工艺路径表"); migrationBuilder.CreateTable( name: "mes_workshop", columns: table => new { Id = table.Column(type: "bigint", nullable: false), name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "工位名称"), subids = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合工位ids"), geoinfo = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "坐标"), building = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "楼栋"), floor = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "楼层"), zone = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "区域"), work_calendar_id = table.Column(type: "bigint", nullable: true, comment: "工作日历id"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_mes_workshop", x => x.Id); }, comment: "工位表(工作中心)"); migrationBuilder.CreateTable( name: "srm_po_list", columns: table => new { Id = table.Column(type: "bigint", nullable: false), po_id = table.Column(type: "bigint", nullable: false, comment: "po单id"), po_billno = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "po单号"), polist_row = table.Column(type: "int", nullable: true, comment: "行号"), pr_id = table.Column(type: "bigint", nullable: false, comment: "pr申请单id"), pr_billno = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "pr申请单号"), po_mono = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "关联工单号"), pr_purchase_id = table.Column(type: "bigint", nullable: false, comment: "供应商id"), pr_purchase_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"), stock_id = table.Column(type: "bigint", nullable: false, comment: "收货仓库id"), stock_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "收货仓库名称"), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料id"), ItemNum = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "物料编码"), icitem_name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "物料名称"), number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编码"), model = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"), deliveryconfirmstate = table.Column(type: "int", nullable: true, comment: "交期确认状态"), logisticsstate = table.Column(type: "int", nullable: true, comment: "物流状态"), qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单数量"), netprice = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "净价"), rate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"), price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "含税单价"), total_price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "总价"), plan_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "计划数量"), unit = table.Column(type: "nvarchar(max)", nullable: true, comment: "单位"), state = table.Column(type: "int", nullable: true, comment: "数据状态标识"), rarrdate = table.Column(type: "datetime2", nullable: true, comment: "需求到货日期"), rstate = table.Column(type: "int", nullable: true, comment: "评审状态"), rnumber = table.Column(type: "int", nullable: false, comment: "评审次数"), shippedqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已发货数量"), rqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已收货数量"), esqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已入库数量"), procurement_rarr_date = table.Column(type: "datetime2", nullable: true, comment: "采购到货日期"), rparrive_date = table.Column(type: "datetime2", nullable: true, comment: "再计划到货日期"), purchase_date = table.Column(type: "datetime2", nullable: true, comment: "供应商交期"), pur_affirmdate = table.Column(type: "datetime2", nullable: true, comment: "采购确认到货日期"), currencytype = table.Column(type: "bigint", nullable: false, comment: "币别"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_srm_po_list", x => x.Id); }, comment: "采购订单明细详情"); migrationBuilder.CreateTable( name: "srm_po_main", columns: table => new { Id = table.Column(type: "bigint", nullable: false), po_billno = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "PO单号"), po_purchaser = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"), po_purchaser_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员工号"), po_ssend_date = table.Column(type: "datetime2", nullable: true, comment: "下单日期"), po_total = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单总价"), po_delivery = table.Column(type: "bigint", nullable: false, comment: "交货方式"), po_tax_rate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"), po_express = table.Column(type: "int", nullable: true, comment: "是否加急"), state = table.Column(type: "int", nullable: true, comment: "数据状态"), po_note = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"), rstate = table.Column(type: "int", nullable: true, comment: "评审状态"), rnumber = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "评审次数"), review_rtime = table.Column(type: "datetime2", nullable: true, comment: "评审通过时间"), po_order_type = table.Column(type: "int", nullable: true, comment: "单据类型"), currency = table.Column(type: "bigint", nullable: false, comment: "币别"), bill_type = table.Column(type: "int", nullable: true, comment: "金蝶单据类型值"), purchasing_orgid = table.Column(type: "bigint", nullable: true, comment: "采购组织id"), purchasing_orgname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "采购组织名称"), telephone = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购联系人电话"), supplier_id = table.Column(type: "bigint", nullable: false, comment: "供应商id"), supplier_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"), supplier_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编号"), contact = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商联系人"), suppliertelephone = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商联系人电话"), deliveryaddress = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "收货地址"), supplierdddress = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "供应地址"), confirmstate = table.Column(type: "int", nullable: true, comment: "确认状态"), logisticsstate = table.Column(type: "int", nullable: true, comment: "物流状态"), financialstate = table.Column(type: "int", nullable: true, comment: "财务状态"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_srm_po_main", x => x.Id); }, comment: "采购订单"); migrationBuilder.CreateTable( name: "srm_po_occupy", columns: table => new { Id = table.Column(type: "bigint", nullable: false), polist_id = table.Column(type: "bigint", nullable: false, comment: "采购订单id"), polist_row = table.Column(type: "int", nullable: true, comment: "采购订单行号"), eid = table.Column(type: "bigint", nullable: true, comment: "客户订单行id"), bill_no = table.Column(type: "bigint", nullable: true, comment: "客户订单id"), type = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "类型"), entry_id = table.Column(type: "int", nullable: false, comment: "行号"), qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "占用量"), stime = table.Column(type: "datetime2", nullable: true, comment: "开始时间"), etime = table.Column(type: "datetime2", nullable: true, comment: "结束时间"), state = table.Column(type: "int", nullable: true, comment: "占用状态"), cby = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "变更人"), creason = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "变更原因"), ctime = table.Column(type: "datetime2", nullable: true, comment: "变更时间"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_srm_po_occupy", x => x.Id); }, comment: "采购订单占用详情"); migrationBuilder.CreateTable( name: "srm_pr_main", columns: table => new { Id = table.Column(type: "bigint", nullable: false), pr_billno = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "pr单号"), pr_mono = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "关联工单号"), entity_id = table.Column(type: "int", nullable: true, comment: "工单行号"), pr_purchaseid = table.Column(type: "bigint", nullable: false, comment: "供应商id"), pr_purchasenumber = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编码"), pr_purchasename = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"), pr_purchaser = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"), pr_purchaser_num = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员工号"), pr_rqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"), pr_aqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "申请数量"), pr_sqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "建议数量"), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料id"), icitem_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"), pr_order_type = table.Column(type: "int", nullable: true, comment: "单据类型"), pr_ssend_date = table.Column(type: "datetime2", nullable: true, comment: "系统建议下单日期"), pr_sarrive_date = table.Column(type: "datetime2", nullable: true, comment: "系统建议到达日期"), pr_bsarrive_date = table.Column(type: "datetime2", nullable: true, comment: "采购员建议到货日期"), pr_oarrive_date = table.Column(type: "datetime2", nullable: true, comment: "订单到货日期"), pr_psend_date = table.Column(type: "datetime2", nullable: true, comment: "计划下单日期"), pr_parrive_date = table.Column(type: "datetime2", nullable: true, comment: "计划到达日期"), pr_rarrive_date = table.Column(type: "datetime2", nullable: true, comment: "需求到货日期"), pr_rparrive_date = table.Column(type: "datetime2", nullable: true, comment: "再计划到货日期"), pr_pur_affirm_date = table.Column(type: "datetime2", nullable: true, comment: "采购确认到货日期"), pr_sysprice = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "系统价格(含税)"), pr_orderprice = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单价格(含税)"), pr_price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购净价(不含税)"), pr_rate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"), pr_unit = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"), state = table.Column(type: "int", nullable: true, comment: "状态"), old_apply_aqty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已申请数量"), pr_type = table.Column(type: "int", nullable: true, comment: "申请类型"), currencytype = table.Column(type: "bigint", nullable: false, comment: "币种"), secInv_ratio = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存触发采购比例"), remark = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"), pr_rreason = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "拒绝原因"), sentry_id = table.Column(type: "bigint", nullable: true, comment: "订单行id"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_srm_pr_main", x => x.Id); }, comment: "采购申请单"); migrationBuilder.CreateTable( name: "srm_purchase", columns: table => new { Id = table.Column(type: "bigint", nullable: false), icitem_id = table.Column(type: "bigint", nullable: false, comment: "物料id"), icitem_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"), sourcelist_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "货源清单编号"), supplier_id = table.Column(type: "bigint", nullable: true, comment: "供应商id"), supplier_number = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编码"), supplier_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"), purchgroup = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购组"), purcher = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"), purchase_unit = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购计量单位"), netpurchase_price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购净价(不含税)"), taxrate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"), currency_type = table.Column(type: "bigint", nullable: true, comment: "币种"), order_rector_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购负责人"), order_rector_num = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购负责人_工号"), factory_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工厂编码"), order_dept = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购部门"), order_price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购单价"), sale_price = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "销售单价"), qty_min = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "最小订货量"), batch_append_qty = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "批量增量"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_srm_purchase", x => x.Id); }, comment: "物料采购报价单"); migrationBuilder.CreateTable( name: "srm_supplier", columns: table => new { Id = table.Column(type: "bigint", nullable: false), supplier_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编号"), supplier_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商名称"), supplier_full_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商全称"), supplier_help_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商助记码"), supplier_short_name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商简称"), supplier_address = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商地址"), state = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "状态"), region = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "区域"), trade = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "行业"), contact = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系人"), telephone = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系电话"), mobile = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "移动电话"), fax = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "传真号码"), post_code = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮政编码"), email = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮件地址"), taxid = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "税务登记号"), bank = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "开户银行"), bank_account = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "银行账号"), value_add_rate = table.Column(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "增值税率"), type = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商分类"), po_mode = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购模式"), vmi_stock = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "VMI仓"), stockid_assignee = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "受托代销虚仓"), branch_info = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "分支机构信息"), regmark = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "注册商标"), licence = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "营业执照"), regster_date = table.Column(type: "datetime2", nullable: true, comment: "注册日期"), approve_date = table.Column(type: "datetime2", nullable: true, comment: "批准日期"), begin_day = table.Column(type: "datetime2", nullable: true, comment: "生效日期"), end_day = table.Column(type: "datetime2", nullable: true, comment: "失效日期"), supply_grade = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商等级"), supply_type = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应类别"), company_type = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "公司类别"), auto_create_mr = table.Column(type: "bit", nullable: true, comment: "交货自动生成收货单据"), auto_validate_order = table.Column(type: "bit", nullable: true, comment: "自动确认订单"), isuse_supplier_portal = table.Column(type: "bit", nullable: true, comment: "启用供应商门户"), department = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "分管部门"), employee_name = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员"), employee_no = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号"), currency = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算币种"), settlement = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算方式"), name_en = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "英文名称"), addr_en = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "英文地址"), country = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "国别地区"), checker = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "审核人"), op_time = table.Column(type: "datetime2", nullable: true, comment: "操作时间"), create_by = table.Column(type: "bigint", nullable: true, comment: "创建人id"), create_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"), create_time = table.Column(type: "datetime2", nullable: true, comment: "创建时间"), update_by = table.Column(type: "bigint", nullable: true, comment: "修改人"), update_by_name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"), update_time = table.Column(type: "datetime2", nullable: true, comment: "修改时间"), tenant_id = table.Column(type: "bigint", nullable: false, comment: "企业ID"), factory_id = table.Column(type: "bigint", nullable: true, comment: "工厂ID"), org_id = table.Column(type: "bigint", nullable: true, comment: "组织ID"), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false, comment: "删除标识") }, constraints: table => { table.PrimaryKey("PK_srm_supplier", x => x.Id); }, comment: "供应商"); migrationBuilder.CreateIndex( name: "IX_crm_customer_customer_no_tenant_id_factory_id", table: "crm_customer", columns: new[] { "customer_no", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_crm_seorder_bill_no_tenant_id_factory_id", table: "crm_seorder", columns: new[] { "bill_no", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_crm_seorderentry_seorder_id_bill_no_item_number_tenant_id_factory_id", table: "crm_seorderentry", columns: new[] { "seorder_id", "bill_no", "item_number", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_bom_bom_number_item_number_version_tenant_id_factory_id", table: "ic_bom", columns: new[] { "bom_number", "item_number", "version", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_bom_child_bom_id_bom_number_item_number_version_tenant_id_factory_id", table: "ic_bom_child", columns: new[] { "bom_id", "bom_number", "item_number", "version", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_item_number_name_tenant_id_factory_id", table: "ic_item", columns: new[] { "number", "name", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_item_inventory_stock_id_stock_place_id_tenant_id_factory_id", table: "ic_item_inventory", columns: new[] { "stock_id", "stock_place_id", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_item_stock_icitem_id_icitem_name_tenant_id_factory_id", table: "ic_item_stock", columns: new[] { "icitem_id", "icitem_name", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_substitute_substitute_code_tenant_id_factory_id", table: "ic_substitute", columns: new[] { "substitute_code", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_substitute_group_substitute_code_tenant_id_factory_id", table: "ic_substitute_group", columns: new[] { "substitute_code", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_ic_substitute_group_detail_substitute_code_icitem_number_tenant_id_factory_id", table: "ic_substitute_group_detail", columns: new[] { "substitute_code", "icitem_number", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_mes_moentry_moentry_moid_moentry_mono_tenant_id_factory_id", table: "mes_moentry", columns: new[] { "moentry_moid", "moentry_mono", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_mes_mooccupy_moo_id_billid_tenant_id_factory_id", table: "mes_mooccupy", columns: new[] { "moo_id_billid", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_mes_morder_morder_no_tenant_id_factory_id", table: "mes_morder", columns: new[] { "morder_no", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_mes_stockoccupy_fbill_no_fitem_number_tenant_id_factory_id", table: "mes_stockoccupy", columns: new[] { "fbill_no", "fitem_number", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_srm_po_list_po_billno_number_tenant_id_factory_id", table: "srm_po_list", columns: new[] { "po_billno", "number", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_srm_po_main_po_billno_tenant_id_factory_id", table: "srm_po_main", columns: new[] { "po_billno", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_srm_po_occupy_polist_id_tenant_id_factory_id", table: "srm_po_occupy", columns: new[] { "polist_id", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_srm_pr_main_pr_billno_pr_purchasenumber_tenant_id_factory_id", table: "srm_pr_main", columns: new[] { "pr_billno", "pr_purchasenumber", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_srm_purchase_icitem_id_supplier_number_tenant_id_factory_id", table: "srm_purchase", columns: new[] { "icitem_id", "supplier_number", "tenant_id", "factory_id" }); migrationBuilder.CreateIndex( name: "IX_srm_supplier_supplier_no_tenant_id_factory_id", table: "srm_supplier", columns: new[] { "supplier_no", "tenant_id", "factory_id" }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "b_bom_pretreatment"); migrationBuilder.DropTable( name: "crm_customer"); migrationBuilder.DropTable( name: "crm_seorder"); migrationBuilder.DropTable( name: "crm_seorderentry"); migrationBuilder.DropTable( name: "ic_bom"); migrationBuilder.DropTable( name: "ic_bom_child"); migrationBuilder.DropTable( name: "ic_item"); migrationBuilder.DropTable( name: "ic_item_inventory"); migrationBuilder.DropTable( name: "ic_item_stock"); migrationBuilder.DropTable( name: "ic_substitute"); migrationBuilder.DropTable( name: "ic_substitute_group"); migrationBuilder.DropTable( name: "ic_substitute_group_detail"); migrationBuilder.DropTable( name: "mes_moentry"); migrationBuilder.DropTable( name: "mes_mooccupy"); migrationBuilder.DropTable( name: "mes_morder"); migrationBuilder.DropTable( name: "mes_oorder"); migrationBuilder.DropTable( name: "mes_process"); migrationBuilder.DropTable( name: "mes_stockoccupy"); migrationBuilder.DropTable( name: "mes_tech_process"); migrationBuilder.DropTable( name: "mes_technique"); migrationBuilder.DropTable( name: "mes_workshop"); migrationBuilder.DropTable( name: "srm_po_list"); migrationBuilder.DropTable( name: "srm_po_main"); migrationBuilder.DropTable( name: "srm_po_occupy"); migrationBuilder.DropTable( name: "srm_pr_main"); migrationBuilder.DropTable( name: "srm_purchase"); migrationBuilder.DropTable( name: "srm_supplier"); } } }