20230529171706_demoInit.cs 129 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Business.Migrations
  5. {
  6. public partial class demoInit : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "b_bom_pretreatment",
  12. columns: table => new
  13. {
  14. Id = table.Column<long>(type: "bigint", nullable: false),
  15. sourceid = table.Column<long>(type: "bigint", nullable: false, comment: "所属BOM"),
  16. fid = table.Column<long>(type: "bigint", nullable: false, comment: "本级id"),
  17. parent_id = table.Column<long>(type: "bigint", nullable: true, comment: "父级"),
  18. bom_child_id = table.Column<long>(type: "bigint", nullable: true, comment: "bom明细主键"),
  19. bom_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom编号"),
  20. item_id = table.Column<long>(type: "bigint", nullable: true, comment: "物料id"),
  21. item_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
  22. model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
  23. item_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编号"),
  24. level = table.Column<int>(type: "int", nullable: false, comment: "level"),
  25. bom_id = table.Column<long>(type: "bigint", nullable: true, comment: "BOMid"),
  26. num = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "项次号"),
  27. num_order = table.Column<long>(type: "bigint", nullable: true, comment: "供排序使用"),
  28. type = table.Column<int>(type: "int", nullable: false, comment: "类型"),
  29. qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位用量"),
  30. unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
  31. erp_cls = table.Column<int>(type: "int", nullable: false, comment: "物料属性"),
  32. erp_cls_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料属性名称"),
  33. backflush = table.Column<int>(type: "int", nullable: false, comment: "是否倒冲"),
  34. haveicsubs = table.Column<int>(type: "int", nullable: false, comment: "存在替代关系"),
  35. substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
  36. substitute_strategy = table.Column<int>(type: "int", nullable: false, comment: "替代策略"),
  37. substitute_mode = table.Column<int>(type: "int", nullable: false, comment: "替代方式"),
  38. version = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"),
  39. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  40. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  41. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  42. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  43. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  44. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  45. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  46. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  47. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  48. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  49. },
  50. constraints: table =>
  51. {
  52. table.PrimaryKey("PK_b_bom_pretreatment", x => x.Id);
  53. },
  54. comment: "Bom预处理");
  55. migrationBuilder.CreateTable(
  56. name: "crm_customer",
  57. columns: table => new
  58. {
  59. Id = table.Column<long>(type: "bigint", nullable: false),
  60. customer_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户编号"),
  61. customer_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户名称"),
  62. customer_level = table.Column<int>(type: "int", maxLength: 255, nullable: true, comment: "客户级别"),
  63. mobile = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "手机号码"),
  64. telephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "电话号码"),
  65. email = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮件地址"),
  66. contact = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系人"),
  67. post_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮政编码"),
  68. country = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "国别地区"),
  69. province = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "省份"),
  70. city = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "城市"),
  71. region = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "区"),
  72. address = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "地址"),
  73. sale_mode = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "销售模式"),
  74. short_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户简称"),
  75. short_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户简码"),
  76. state = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "状态"),
  77. value_add_rate = table.Column<decimal>(type: "decimal(18,10)", precision: 18, scale: 10, nullable: true, comment: "增值税率"),
  78. carrying_aos = table.Column<int>(type: "int", nullable: false, comment: "默认运输提前期_天"),
  79. corperate = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "法人代表"),
  80. currency = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算币种"),
  81. employee_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员"),
  82. employee_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号"),
  83. op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
  84. cust_type_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户类别编码"),
  85. cust_type = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户类别"),
  86. cust_group_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户分组编号"),
  87. cust_group_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户分组名称"),
  88. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  89. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  90. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  91. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  92. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  93. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  94. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  95. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  96. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  97. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  98. },
  99. constraints: table =>
  100. {
  101. table.PrimaryKey("PK_crm_customer", x => x.Id);
  102. },
  103. comment: "客户");
  104. migrationBuilder.CreateTable(
  105. name: "crm_seorder",
  106. columns: table => new
  107. {
  108. Id = table.Column<long>(type: "bigint", nullable: false),
  109. bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单编号"),
  110. order_type = table.Column<int>(type: "int", nullable: true, comment: "订单类别(销售、计划)"),
  111. trade_type = table.Column<int>(type: "int", nullable: true, comment: "贸易类型"),
  112. sale_style = table.Column<int>(type: "int", nullable: true, comment: "销售订单类型"),
  113. sale_style_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售订单类型编码"),
  114. custom_id = table.Column<int>(type: "int", nullable: true, comment: "客户id"),
  115. custom_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户名称"),
  116. custom_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户编码"),
  117. custom_level = table.Column<int>(type: "int", maxLength: 80, nullable: true, comment: "客户级别"),
  118. date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "签订日期"),
  119. rdate = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购下单日期"),
  120. urgent = table.Column<int>(type: "int", nullable: false, comment: "加急级别"),
  121. currency = table.Column<int>(type: "int", maxLength: 50, nullable: true, comment: "币种"),
  122. exchange_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "汇率"),
  123. biller = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "制单人"),
  124. emp_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "业务员工号"),
  125. emp_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "业务员名称"),
  126. auditor = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "审核人"),
  127. audit_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "审核日期"),
  128. status = table.Column<int>(type: "int", nullable: true, comment: "订单状态"),
  129. closed = table.Column<bool>(type: "bit", nullable: false, comment: "是否关闭1关闭0未关闭"),
  130. op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
  131. bill_from = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "订单来源"),
  132. project_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"),
  133. project_code = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目编号"),
  134. out_stock_type = table.Column<int>(type: "int", nullable: true, comment: "销售出库类型"),
  135. sale_dept_id = table.Column<long>(type: "bigint", nullable: true, comment: "销售部门id"),
  136. sale_dept_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售部门名称"),
  137. sale_dept_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售部门编号"),
  138. create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
  139. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  140. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  141. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  142. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  143. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  144. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  145. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  146. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  147. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  148. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  149. },
  150. constraints: table =>
  151. {
  152. table.PrimaryKey("PK_crm_seorder", x => x.Id);
  153. },
  154. comment: "销售订单表");
  155. migrationBuilder.CreateTable(
  156. name: "crm_seorderentry",
  157. columns: table => new
  158. {
  159. Id = table.Column<long>(type: "bigint", nullable: false),
  160. seorder_id = table.Column<long>(type: "bigint", nullable: true, comment: "销售订单id"),
  161. bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "销售订单编号"),
  162. entry_seq = table.Column<int>(type: "int", nullable: true, comment: "行号"),
  163. map_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "对应代码"),
  164. map_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "代码名称"),
  165. item_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "产品代码"),
  166. fms_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "FMS旧料号"),
  167. item_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "产品名称"),
  168. specification = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "规格型号"),
  169. urgent = table.Column<int>(type: "int", nullable: true, comment: "加急级别"),
  170. bom_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "BOM编号"),
  171. unit = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "单位"),
  172. qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单数量"),
  173. price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单价"),
  174. tax_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "含税单价"),
  175. amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "金额"),
  176. tax_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
  177. discount_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "折扣率"),
  178. discount_amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "折扣额"),
  179. aux_price_discount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "实际含税单价"),
  180. tax_amtount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "销项税额"),
  181. total_amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "价税合计"),
  182. plan_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "客户要求交期"),
  183. date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最终交货日期"),
  184. planner_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "计划员"),
  185. planner_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "计划员_工号"),
  186. remark = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "备注"),
  187. soure_bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "源单编号"),
  188. custom_order_bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "客户订单号"),
  189. custom_order_entryid = table.Column<int>(type: "int", nullable: true, comment: "客户订单行号"),
  190. sys_capacity_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议交期(产能)"),
  191. adjust_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "调整建议交期"),
  192. mrp_closed = table.Column<bool>(type: "bit", nullable: true, comment: "mrp关闭"),
  193. op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
  194. custom_order_itemno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户料号"),
  195. state = table.Column<bool>(type: "bit", nullable: true, comment: "数据状态标识 0停用 1启用"),
  196. rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
  197. rnumber = table.Column<int>(type: "int", nullable: true, comment: "评审次数"),
  198. progress = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "订单进度"),
  199. deliver_notice_count = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发货通知单数量"),
  200. deliver_count = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发货数量(已出库数量)"),
  201. se_reject_reason = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "业务员工号"),
  202. out_stock_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "出库类型"),
  203. is_checked = table.Column<bool>(type: "bit", nullable: true, comment: "是否完成检测,0未完成,1完成"),
  204. sys_material_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议交期(物料)"),
  205. contract_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "合同编号"),
  206. create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
  207. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  208. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  209. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  210. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  211. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  212. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  213. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  214. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  215. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  216. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  217. },
  218. constraints: table =>
  219. {
  220. table.PrimaryKey("PK_crm_seorderentry", x => x.Id);
  221. },
  222. comment: "销售订单明细表");
  223. migrationBuilder.CreateTable(
  224. name: "ic_bom",
  225. columns: table => new
  226. {
  227. Id = table.Column<long>(type: "bigint", nullable: false),
  228. bom_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom单编号"),
  229. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  230. item_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料代码"),
  231. item_name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"),
  232. bom_num = table.Column<int>(type: "int", nullable: true, comment: "序号"),
  233. use_status = table.Column<int>(type: "int", nullable: true, comment: "使用状态"),
  234. begin_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生效日期"),
  235. end_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "失效日期"),
  236. product_principal = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "生产负责人"),
  237. product_designer = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品设计员"),
  238. version = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"),
  239. chartnumber = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图表编号"),
  240. biller = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图片"),
  241. checker = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "检验人"),
  242. check_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "检验时间"),
  243. user = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom创建人"),
  244. use_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "bom创建时间"),
  245. unit = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"),
  246. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  247. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  248. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  249. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  250. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  251. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  252. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  253. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  254. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  255. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  256. },
  257. constraints: table =>
  258. {
  259. table.PrimaryKey("PK_ic_bom", x => x.Id);
  260. },
  261. comment: "物料BOM");
  262. migrationBuilder.CreateTable(
  263. name: "ic_bom_child",
  264. columns: table => new
  265. {
  266. Id = table.Column<long>(type: "bigint", nullable: false),
  267. bom_id = table.Column<long>(type: "bigint", nullable: false, comment: "bom主键"),
  268. bom_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom单编号"),
  269. is_bom = table.Column<int>(type: "int", nullable: true, comment: "是否是BOM"),
  270. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  271. item_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料代码"),
  272. item_name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"),
  273. unit = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"),
  274. qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "用量"),
  275. scrap = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "损耗率"),
  276. backflush = table.Column<int>(type: "int", nullable: true, comment: "是否倒冲"),
  277. iskeyitem = table.Column<int>(type: "int", nullable: true, comment: "是否关键件"),
  278. haveicsubs = table.Column<int>(type: "int", nullable: true, comment: "存在替代关系"),
  279. substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
  280. is_replace = table.Column<int>(type: "int", nullable: true, comment: "是否群组替代"),
  281. icitem_ids = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合模式"),
  282. note = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"),
  283. entryid = table.Column<int>(type: "int", nullable: true, comment: "顺序号"),
  284. type = table.Column<int>(type: "int", nullable: true, comment: "物料类型"),
  285. erp_cls = table.Column<int>(type: "int", nullable: true, comment: "物料属性"),
  286. use_status = table.Column<int>(type: "int", nullable: true, comment: "使用状态"),
  287. begin_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生效日期"),
  288. end_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "失效日期"),
  289. op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
  290. child_num = table.Column<int>(type: "int", nullable: true, comment: "序号"),
  291. version = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"),
  292. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  293. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  294. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  295. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  296. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  297. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  298. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  299. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  300. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  301. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  302. },
  303. constraints: table =>
  304. {
  305. table.PrimaryKey("PK_ic_bom_child", x => x.Id);
  306. },
  307. comment: "物料BOM明细");
  308. migrationBuilder.CreateTable(
  309. name: "ic_item",
  310. columns: table => new
  311. {
  312. Id = table.Column<long>(type: "bigint", nullable: false),
  313. number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编码"),
  314. name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
  315. model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
  316. full_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "全名"),
  317. fms_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"),
  318. erp_oldnumber = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "erp旧料号"),
  319. chart_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图号"),
  320. fversion = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本号"),
  321. box_model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "盒贴规格"),
  322. erp_cls = table.Column<int>(type: "int", nullable: true, comment: "物料属性"),
  323. erp_cls_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料属性"),
  324. unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
  325. item_level = table.Column<long>(type: "bigint", nullable: true, comment: "物料等级"),
  326. standard_manhour = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位标准工时_小时"),
  327. unititem_amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位材料定额_元"),
  328. source = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "来源"),
  329. is_equipment = table.Column<int>(type: "int", nullable: true, comment: "是否为设备"),
  330. unit_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位包装数量"),
  331. iskeyitem = table.Column<int>(type: "int", nullable: true, comment: "是否关键件"),
  332. gross_weight = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "毛重"),
  333. net_weight = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "净重"),
  334. maund = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "重量单位"),
  335. length = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "长度"),
  336. cubic_measure = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "长度单位"),
  337. width = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "宽度"),
  338. height = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "高度"),
  339. size = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "体积"),
  340. allowpur = table.Column<int>(type: "int", nullable: true, comment: "允许采购"),
  341. allowsale = table.Column<int>(type: "int", nullable: true, comment: "允许销售"),
  342. allowmanu = table.Column<int>(type: "int", nullable: true, comment: "允许生产"),
  343. allowout = table.Column<int>(type: "int", nullable: true, comment: "允许委外"),
  344. allowbatch = table.Column<int>(type: "int", nullable: true, comment: "批号管理"),
  345. allowserial = table.Column<int>(type: "int", nullable: true, comment: "序列号管理"),
  346. photo = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图片"),
  347. picktype = table.Column<long>(type: "bigint", nullable: true, comment: "领料类型"),
  348. output_type_id = table.Column<long>(type: "bigint", nullable: true, comment: "出库类型"),
  349. enable_warning = table.Column<int>(type: "int", nullable: true, comment: "启用预警"),
  350. life_state = table.Column<int>(type: "int", nullable: true, comment: "生命周期状态"),
  351. moq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "经济生产批量"),
  352. maq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "最大生产批量"),
  353. is_clean = table.Column<int>(type: "int", nullable: true, comment: "是否备料前预处理"),
  354. clean_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "预处理提前期"),
  355. sterilize_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工序委外提前期"),
  356. transfer_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "平台调拨提前期"),
  357. standard_period = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "标准工期"),
  358. fmr = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "FMR分类"),
  359. abc = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "ABC分类"),
  360. fix_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "固定提前期(天)"),
  361. plan_trategy = table.Column<int>(type: "int", nullable: true, comment: "计划策略"),
  362. order_trategy = table.Column<int>(type: "int", nullable: true, comment: "订货策略"),
  363. order_inter_val = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订货间隔期_天"),
  364. lead_time = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "变动提前期"),
  365. bat_change_economy = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "变动提前期批量"),
  366. total_tqq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "累计提前期"),
  367. order_point = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "再订货点"),
  368. isfixedreorder = table.Column<int>(type: "int", nullable: true, comment: "设置为固定再订货点"),
  369. secinv = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存数量"),
  370. secinv_ratio = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存触发采购比例"),
  371. self_inspection_date = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "自检提前期"),
  372. Warehousing_date = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库提前期"),
  373. Shipping_date = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发运提前期"),
  374. product_line = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品线"),
  375. batch_manager = table.Column<int>(type: "int", nullable: false, comment: "是否采用业务批次管理"),
  376. ordissu_days = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单发料时间/天"),
  377. transportation_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "运输中提前期_天"),
  378. stock_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "仓库中提前期_天"),
  379. production_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "生产中提前期_天"),
  380. order_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "下单前置期_天"),
  381. minpackqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "最小包装量"),
  382. minorderqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "最小订单量"),
  383. isbackflush = table.Column<int>(type: "int", nullable: true, comment: "是否倒冲"),
  384. put_integer = table.Column<int>(type: "int", nullable: true, comment: "投料自动取整"),
  385. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  386. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  387. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  388. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  389. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  390. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  391. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  392. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  393. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  394. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  395. },
  396. constraints: table =>
  397. {
  398. table.PrimaryKey("PK_ic_item", x => x.Id);
  399. },
  400. comment: "物料详情");
  401. migrationBuilder.CreateTable(
  402. name: "ic_item_inventory",
  403. columns: table => new
  404. {
  405. Id = table.Column<long>(type: "bigint", nullable: false),
  406. icitem_stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料库存主键"),
  407. stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "仓库id"),
  408. stock_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "仓库名称"),
  409. stock_place_id = table.Column<long>(type: "bigint", nullable: false, comment: "库位id"),
  410. stock_place_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "库位编码"),
  411. batch_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "批次号"),
  412. qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "数量"),
  413. bal = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "金额"),
  414. kf_period = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "保质期时长"),
  415. kf_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "保质期时间"),
  416. qty_lock = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "锁定库存"),
  417. sec_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存"),
  418. unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
  419. rq = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "日期"),
  420. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  421. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  422. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  423. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  424. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  425. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  426. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  427. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  428. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  429. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  430. },
  431. constraints: table =>
  432. {
  433. table.PrimaryKey("PK_ic_item_inventory", x => x.Id);
  434. },
  435. comment: "物料库存明细表");
  436. migrationBuilder.CreateTable(
  437. name: "ic_item_stock",
  438. columns: table => new
  439. {
  440. Id = table.Column<long>(type: "bigint", nullable: false),
  441. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  442. icitem_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
  443. sqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "物料库存量"),
  444. quantity_in_transit = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "调拨在途数量"),
  445. factory_fode = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工厂编码"),
  446. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  447. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  448. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  449. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  450. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  451. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  452. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  453. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  454. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  455. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  456. },
  457. constraints: table =>
  458. {
  459. table.PrimaryKey("PK_ic_item_stock", x => x.Id);
  460. },
  461. comment: "物料库存表");
  462. migrationBuilder.CreateTable(
  463. name: "ic_substitute",
  464. columns: table => new
  465. {
  466. Id = table.Column<long>(type: "bigint", nullable: false),
  467. substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
  468. substitute_type = table.Column<int>(type: "int", nullable: true, comment: "替代类型"),
  469. substitute_strategy = table.Column<int>(type: "int", nullable: true, comment: "替代策略"),
  470. substitute_mode = table.Column<int>(type: "int", nullable: true, comment: "替代方式"),
  471. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  472. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  473. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  474. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  475. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  476. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  477. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  478. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  479. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  480. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  481. },
  482. constraints: table =>
  483. {
  484. table.PrimaryKey("PK_ic_substitute", x => x.Id);
  485. },
  486. comment: "替代群组");
  487. migrationBuilder.CreateTable(
  488. name: "ic_substitute_group",
  489. columns: table => new
  490. {
  491. Id = table.Column<long>(type: "bigint", nullable: false),
  492. substitute_group_id = table.Column<long>(type: "bigint", nullable: false, comment: "群组主键"),
  493. substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
  494. replace_relation = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "替代关系"),
  495. replace_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "替代名称"),
  496. replace_way = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "替代方式"),
  497. product_line = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "产品线"),
  498. use_model = table.Column<string>(type: "nvarchar(max)", maxLength: 5000, nullable: true, comment: "使用机型"),
  499. order_num = table.Column<int>(type: "int", nullable: true, comment: "群组优先级"),
  500. main_material = table.Column<int>(type: "int", nullable: true, comment: "主料/替代料"),
  501. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  502. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  503. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  504. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  505. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  506. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  507. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  508. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  509. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  510. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  511. },
  512. constraints: table =>
  513. {
  514. table.PrimaryKey("PK_ic_substitute_group", x => x.Id);
  515. },
  516. comment: "物料替代多群组");
  517. migrationBuilder.CreateTable(
  518. name: "ic_substitute_group_detail",
  519. columns: table => new
  520. {
  521. Id = table.Column<long>(type: "bigint", nullable: false),
  522. substitute_group_id = table.Column<long>(type: "bigint", nullable: false, comment: "替代多群组主键"),
  523. substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
  524. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料主键"),
  525. icitem_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "物料编码"),
  526. ismain = table.Column<int>(type: "int", nullable: true, comment: "主/替"),
  527. seq = table.Column<int>(type: "int", nullable: true, comment: "序号"),
  528. replace_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "替代数量"),
  529. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  530. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  531. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  532. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  533. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  534. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  535. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  536. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  537. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  538. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  539. },
  540. constraints: table =>
  541. {
  542. table.PrimaryKey("PK_ic_substitute_group_detail", x => x.Id);
  543. },
  544. comment: "物料替代多群组明细");
  545. migrationBuilder.CreateTable(
  546. name: "mes_moentry",
  547. columns: table => new
  548. {
  549. Id = table.Column<long>(type: "bigint", nullable: false),
  550. moentry_moid = table.Column<long>(type: "bigint", nullable: true, comment: "工单主表id"),
  551. moentry_mono = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工单编号"),
  552. soentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
  553. fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行号"),
  554. fbill_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "订单编号"),
  555. unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
  556. morder_production_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
  557. need_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"),
  558. remaining_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "剩余可用数量"),
  559. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  560. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  561. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  562. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  563. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  564. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  565. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  566. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  567. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  568. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  569. },
  570. constraints: table =>
  571. {
  572. table.PrimaryKey("PK_mes_moentry", x => x.Id);
  573. },
  574. comment: "生成工单子表");
  575. migrationBuilder.CreateTable(
  576. name: "mes_mooccupy",
  577. columns: table => new
  578. {
  579. Id = table.Column<long>(type: "bigint", nullable: false),
  580. moo_id_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "类型--原始,分配"),
  581. moo_id_billid = table.Column<long>(type: "bigint", nullable: true, comment: "订单id"),
  582. fbill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单号"),
  583. fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "行号"),
  584. fitem_number = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "物料编码"),
  585. fitem_name = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "物料名称"),
  586. fmodel = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"),
  587. moo_moid = table.Column<long>(type: "bigint", nullable: true, comment: "工单id"),
  588. moo_mo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工单号"),
  589. moo_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "占用量"),
  590. moo_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
  591. moo_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "结束时间"),
  592. moo_state = table.Column<int>(type: "int", nullable: true, comment: "占用状态-1占用 默认0"),
  593. moo_cbr = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "变更人"),
  594. moo_ctime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "变更时间"),
  595. moo_creason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "变更原因"),
  596. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  597. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  598. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  599. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  600. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  601. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  602. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  603. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  604. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  605. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  606. },
  607. constraints: table =>
  608. {
  609. table.PrimaryKey("PK_mes_mooccupy", x => x.Id);
  610. },
  611. comment: "在制工单占用记录表");
  612. migrationBuilder.CreateTable(
  613. name: "mes_morder",
  614. columns: table => new
  615. {
  616. Id = table.Column<long>(type: "bigint", nullable: false),
  617. parent_id = table.Column<long>(type: "bigint", nullable: true, comment: "上级工单id"),
  618. relation_moid = table.Column<long>(type: "bigint", nullable: true, comment: "关联工单id"),
  619. relation_mono = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "关联编号"),
  620. morder_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "生产工单编号"),
  621. morder_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单类型(类型:计划工单、销售工单、委外工单、预测工单)"),
  622. morder_icitem_type = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "工单所属物料类型"),
  623. work_order_type = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "工单类型(类型:发货工单、试产工单、备库工单、常规工单、返工工单)"),
  624. morder_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生产工单日期"),
  625. morder_state = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单状态(订单状态:初始,下达,暂停、完成)"),
  626. moentry_prd = table.Column<long>(type: "bigint", nullable: true, comment: "生产组织id"),
  627. moentry_prdname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称"),
  628. moentry_wrkc = table.Column<long>(type: "bigint", nullable: true, comment: "工作中心id"),
  629. moentry_wrkcname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称"),
  630. planner_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员工号"),
  631. planner_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员名称"),
  632. moentry_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生产工单开始日期"),
  633. moentry_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生产工单结束日期"),
  634. moentry_sys_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议开工时间"),
  635. moentry_sys_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议完工时间"),
  636. reality_start_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "实际开始时间"),
  637. reality_end_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "实际结束时间"),
  638. planner_start_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划员设定开始时间"),
  639. planner_end_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划员设定结束时间"),
  640. mat_start_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "基于物料开始时间"),
  641. mat_end_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "基于物料结束时间"),
  642. product_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品代码"),
  643. product_name = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "产品名称"),
  644. fms_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"),
  645. fmodel = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"),
  646. bom_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "bom编码"),
  647. unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
  648. morder_progress = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "工单进度"),
  649. morder_need_time = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单所需工时"),
  650. morder_production_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
  651. need_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"),
  652. remaining_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "剩余可用数量"),
  653. work_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报工数量"),
  654. inspection_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报检数量"),
  655. qualified_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "合格数量"),
  656. inventory_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库数量"),
  657. notice_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已开入库通知单数量"),
  658. moentry_startup_status = table.Column<int>(type: "int", nullable: true, comment: "启动状态"),
  659. start_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
  660. pause_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近暂停时间"),
  661. restart_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近重启时间"),
  662. project_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"),
  663. overdue_Remark = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "逾期原因备注"),
  664. picking_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已领料数量"),
  665. morder_fstate = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "前状态--计划、下达、完成、关闭"),
  666. morder_batchno = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "工单批号--(批号管理的物料出入库要使用)"),
  667. convey_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "下达日期"),
  668. urgent = table.Column<int>(type: "int", nullable: false, comment: "加急级别"),
  669. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  670. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  671. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  672. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  673. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  674. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  675. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  676. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  677. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  678. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  679. },
  680. constraints: table =>
  681. {
  682. table.PrimaryKey("PK_mes_morder", x => x.Id);
  683. },
  684. comment: "工单主表");
  685. migrationBuilder.CreateTable(
  686. name: "mes_oorder",
  687. columns: table => new
  688. {
  689. Id = table.Column<long>(type: "bigint", nullable: false),
  690. oorder_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单编号"),
  691. oorder_type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "生产工单类型"),
  692. oorder_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "委外订单日期"),
  693. oorder_state = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单状态"),
  694. ooentry_prd = table.Column<long>(type: "bigint", nullable: true, comment: "生产组织"),
  695. ooentry_prdname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称"),
  696. ooentry_wrkc = table.Column<long>(type: "bigint", nullable: true, comment: "工作中心id"),
  697. ooentry_wrkcname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称"),
  698. planner_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员工号"),
  699. planner_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员名称"),
  700. ooentry_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划开工日期"),
  701. ooentry_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划完工日期"),
  702. product_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品代码"),
  703. ffms_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"),
  704. product_name = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "产品名称"),
  705. specification_model = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"),
  706. bom_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "bom编码"),
  707. unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
  708. morder_progress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "工单进度"),
  709. morder_production_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
  710. need_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "需求数量"),
  711. remaining_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "剩余可用数量"),
  712. work_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报工数量"),
  713. inspection_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报检数量"),
  714. qualified_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "合格数量"),
  715. inventory_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库数量"),
  716. notice_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已开通知单数量"),
  717. moentry_on = table.Column<int>(type: "int", nullable: true, comment: "启动状态"),
  718. start_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
  719. pause_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近暂停时间"),
  720. restart_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近重启时间"),
  721. project_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"),
  722. sent_status = table.Column<int>(type: "int", nullable: true, comment: "发料状态 1-待发料 2-已发料"),
  723. production_unit = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "加工单位"),
  724. production_unit_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "加工单位编码"),
  725. need_icitem_status = table.Column<int>(type: "int", nullable: true, comment: "所需物料是否充足 1-充足 0-缺料"),
  726. sentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
  727. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  728. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  729. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  730. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  731. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  732. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  733. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  734. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  735. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  736. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  737. },
  738. constraints: table =>
  739. {
  740. table.PrimaryKey("PK_mes_oorder", x => x.Id);
  741. },
  742. comment: "委外订单表");
  743. migrationBuilder.CreateTable(
  744. name: "mes_process",
  745. columns: table => new
  746. {
  747. Id = table.Column<long>(type: "bigint", nullable: false),
  748. proc_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "工序名称"),
  749. short_desc = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "简述"),
  750. long_desc = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "详细描述"),
  751. subids = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合工序id"),
  752. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  753. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  754. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  755. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  756. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  757. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  758. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  759. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  760. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  761. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  762. },
  763. constraints: table =>
  764. {
  765. table.PrimaryKey("PK_mes_process", x => x.Id);
  766. },
  767. comment: "工序表");
  768. migrationBuilder.CreateTable(
  769. name: "mes_stockoccupy",
  770. columns: table => new
  771. {
  772. Id = table.Column<long>(type: "bigint", nullable: false),
  773. soccupy_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "类型"),
  774. soentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
  775. fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行号"),
  776. fbill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单编号"),
  777. fitem_number = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "物料编码"),
  778. fitem_name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"),
  779. fmodel = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
  780. warehouse_id = table.Column<long>(type: "bigint", nullable: false, comment: "仓库id"),
  781. warehouse_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "仓库名称"),
  782. warehouse_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "仓库类型"),
  783. occupyqty = table.Column<decimal>(type: "decimal(20,2)", precision: 20, scale: 2, nullable: true, comment: "占用量"),
  784. soccupy_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
  785. soccupy_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "结束时间"),
  786. soccupy_state = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "占用状态"),
  787. soccupy_cby = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "变更人"),
  788. soccupy_ctime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "变更时间"),
  789. soccupy_creason = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "变更原因"),
  790. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  791. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  792. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  793. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  794. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  795. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  796. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  797. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  798. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  799. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  800. },
  801. constraints: table =>
  802. {
  803. table.PrimaryKey("PK_mes_stockoccupy", x => x.Id);
  804. },
  805. comment: "成品库存占用表");
  806. migrationBuilder.CreateTable(
  807. name: "mes_tech_process",
  808. columns: table => new
  809. {
  810. Id = table.Column<long>(type: "bigint", nullable: false),
  811. tech_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺主键"),
  812. proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工序主键"),
  813. level = table.Column<int>(type: "int", nullable: false, comment: "组合层级"),
  814. is_schedule = table.Column<int>(type: "int", nullable: false, comment: "是否需要排产:1-是;0-否"),
  815. readytime = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "前置准备时间"),
  816. wctype = table.Column<int>(type: "int", nullable: true, comment: "工作中心类型"),
  817. lq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "前置最小数量"),
  818. lqt = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "前置等待时间"),
  819. upp = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "子工序加工数量"),
  820. upe = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "一次可加工数量"),
  821. wsinuse = table.Column<int>(type: "int", nullable: true, comment: "实际运行工位数"),
  822. uph = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "UPH"),
  823. ct = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "节拍时间"),
  824. effect_ratio = table.Column<decimal>(type: "decimal(10,4)", precision: 10, scale: 4, nullable: true, comment: "效率系数"),
  825. mototrack = table.Column<int>(type: "int", nullable: true, comment: "是否需要跟踪工序"),
  826. nextprocid = table.Column<long>(type: "bigint", nullable: true, comment: "下一工序id"),
  827. parentprocid = table.Column<long>(type: "bigint", nullable: true, comment: "父级工序id"),
  828. needqc = table.Column<int>(type: "int", nullable: true, comment: "是否需要质检"),
  829. maxworkshop = table.Column<int>(type: "int", nullable: true, comment: "最大并行工位数"),
  830. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  831. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  832. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  833. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  834. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  835. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  836. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  837. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  838. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  839. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  840. },
  841. constraints: table =>
  842. {
  843. table.PrimaryKey("PK_mes_tech_process", x => x.Id);
  844. },
  845. comment: "工艺关联工序表");
  846. migrationBuilder.CreateTable(
  847. name: "mes_technique",
  848. columns: table => new
  849. {
  850. Id = table.Column<long>(type: "bigint", nullable: false),
  851. tech_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "工艺路径名称"),
  852. level = table.Column<int>(type: "int", nullable: true, comment: "效率计算层级"),
  853. bom = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "产品"),
  854. bomver = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "产品版本"),
  855. desc = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "描述"),
  856. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  857. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  858. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  859. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  860. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  861. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  862. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  863. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  864. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  865. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  866. },
  867. constraints: table =>
  868. {
  869. table.PrimaryKey("PK_mes_technique", x => x.Id);
  870. },
  871. comment: "工艺路径表");
  872. migrationBuilder.CreateTable(
  873. name: "mes_workshop",
  874. columns: table => new
  875. {
  876. Id = table.Column<long>(type: "bigint", nullable: false),
  877. name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "工位名称"),
  878. subids = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合工位ids"),
  879. geoinfo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "坐标"),
  880. building = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "楼栋"),
  881. floor = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "楼层"),
  882. zone = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "区域"),
  883. work_calendar_id = table.Column<long>(type: "bigint", nullable: true, comment: "工作日历id"),
  884. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  885. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  886. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  887. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  888. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  889. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  890. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  891. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  892. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  893. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  894. },
  895. constraints: table =>
  896. {
  897. table.PrimaryKey("PK_mes_workshop", x => x.Id);
  898. },
  899. comment: "工位表(工作中心)");
  900. migrationBuilder.CreateTable(
  901. name: "srm_po_list",
  902. columns: table => new
  903. {
  904. Id = table.Column<long>(type: "bigint", nullable: false),
  905. po_id = table.Column<long>(type: "bigint", nullable: false, comment: "po单id"),
  906. po_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "po单号"),
  907. polist_row = table.Column<int>(type: "int", nullable: true, comment: "行号"),
  908. pr_id = table.Column<long>(type: "bigint", nullable: false, comment: "pr申请单id"),
  909. pr_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "pr申请单号"),
  910. po_mono = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "关联工单号"),
  911. pr_purchase_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  912. pr_purchase_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
  913. stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "收货仓库id"),
  914. stock_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "收货仓库名称"),
  915. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  916. ItemNum = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "物料编码"),
  917. icitem_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "物料名称"),
  918. number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编码"),
  919. model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
  920. deliveryconfirmstate = table.Column<int>(type: "int", nullable: true, comment: "交期确认状态"),
  921. logisticsstate = table.Column<int>(type: "int", nullable: true, comment: "物流状态"),
  922. qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单数量"),
  923. netprice = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "净价"),
  924. rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
  925. price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "含税单价"),
  926. total_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "总价"),
  927. plan_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "计划数量"),
  928. unit = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "单位"),
  929. state = table.Column<int>(type: "int", nullable: true, comment: "数据状态标识"),
  930. rarrdate = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "需求到货日期"),
  931. rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
  932. rnumber = table.Column<int>(type: "int", nullable: false, comment: "评审次数"),
  933. shippedqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已发货数量"),
  934. rqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已收货数量"),
  935. esqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已入库数量"),
  936. procurement_rarr_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购到货日期"),
  937. rparrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "再计划到货日期"),
  938. purchase_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "供应商交期"),
  939. pur_affirmdate = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购确认到货日期"),
  940. currencytype = table.Column<long>(type: "bigint", nullable: false, comment: "币别"),
  941. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  942. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  943. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  944. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  945. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  946. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  947. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  948. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  949. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  950. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  951. },
  952. constraints: table =>
  953. {
  954. table.PrimaryKey("PK_srm_po_list", x => x.Id);
  955. },
  956. comment: "采购订单明细详情");
  957. migrationBuilder.CreateTable(
  958. name: "srm_po_main",
  959. columns: table => new
  960. {
  961. Id = table.Column<long>(type: "bigint", nullable: false),
  962. po_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "PO单号"),
  963. po_purchaser = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"),
  964. po_purchaser_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员工号"),
  965. po_ssend_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "下单日期"),
  966. po_total = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单总价"),
  967. po_delivery = table.Column<long>(type: "bigint", nullable: false, comment: "交货方式"),
  968. po_tax_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
  969. po_express = table.Column<int>(type: "int", nullable: true, comment: "是否加急"),
  970. state = table.Column<int>(type: "int", nullable: true, comment: "数据状态"),
  971. po_note = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"),
  972. rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
  973. rnumber = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "评审次数"),
  974. review_rtime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "评审通过时间"),
  975. po_order_type = table.Column<int>(type: "int", nullable: true, comment: "单据类型"),
  976. currency = table.Column<long>(type: "bigint", nullable: false, comment: "币别"),
  977. bill_type = table.Column<int>(type: "int", nullable: true, comment: "金蝶单据类型值"),
  978. purchasing_orgid = table.Column<long>(type: "bigint", nullable: true, comment: "采购组织id"),
  979. purchasing_orgname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "采购组织名称"),
  980. telephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购联系人电话"),
  981. supplier_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  982. supplier_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
  983. supplier_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编号"),
  984. contact = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商联系人"),
  985. suppliertelephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商联系人电话"),
  986. deliveryaddress = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "收货地址"),
  987. supplierdddress = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "供应地址"),
  988. confirmstate = table.Column<int>(type: "int", nullable: true, comment: "确认状态"),
  989. logisticsstate = table.Column<int>(type: "int", nullable: true, comment: "物流状态"),
  990. financialstate = table.Column<int>(type: "int", nullable: true, comment: "财务状态"),
  991. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  992. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  993. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  994. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  995. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  996. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  997. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  998. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  999. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1000. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  1001. },
  1002. constraints: table =>
  1003. {
  1004. table.PrimaryKey("PK_srm_po_main", x => x.Id);
  1005. },
  1006. comment: "采购订单");
  1007. migrationBuilder.CreateTable(
  1008. name: "srm_po_occupy",
  1009. columns: table => new
  1010. {
  1011. Id = table.Column<long>(type: "bigint", nullable: false),
  1012. polist_id = table.Column<long>(type: "bigint", nullable: false, comment: "采购订单id"),
  1013. polist_row = table.Column<int>(type: "int", nullable: true, comment: "采购订单行号"),
  1014. eid = table.Column<long>(type: "bigint", nullable: true, comment: "客户订单行id"),
  1015. bill_no = table.Column<long>(type: "bigint", nullable: true, comment: "客户订单id"),
  1016. type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "类型"),
  1017. entry_id = table.Column<int>(type: "int", nullable: false, comment: "行号"),
  1018. qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "占用量"),
  1019. stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
  1020. etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "结束时间"),
  1021. state = table.Column<int>(type: "int", nullable: true, comment: "占用状态"),
  1022. cby = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "变更人"),
  1023. creason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "变更原因"),
  1024. ctime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "变更时间"),
  1025. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1026. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  1027. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  1028. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1029. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  1030. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  1031. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1032. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1033. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1034. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  1035. },
  1036. constraints: table =>
  1037. {
  1038. table.PrimaryKey("PK_srm_po_occupy", x => x.Id);
  1039. },
  1040. comment: "采购订单占用详情");
  1041. migrationBuilder.CreateTable(
  1042. name: "srm_pr_main",
  1043. columns: table => new
  1044. {
  1045. Id = table.Column<long>(type: "bigint", nullable: false),
  1046. pr_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "pr单号"),
  1047. pr_mono = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "关联工单号"),
  1048. entity_id = table.Column<int>(type: "int", nullable: true, comment: "工单行号"),
  1049. pr_purchaseid = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  1050. pr_purchasenumber = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编码"),
  1051. pr_purchasename = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
  1052. pr_purchaser = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"),
  1053. pr_purchaser_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员工号"),
  1054. pr_rqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"),
  1055. pr_aqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "申请数量"),
  1056. pr_sqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "建议数量"),
  1057. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  1058. icitem_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
  1059. pr_order_type = table.Column<int>(type: "int", nullable: true, comment: "单据类型"),
  1060. pr_ssend_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议下单日期"),
  1061. pr_sarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议到达日期"),
  1062. pr_bsarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购员建议到货日期"),
  1063. pr_oarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "订单到货日期"),
  1064. pr_psend_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划下单日期"),
  1065. pr_parrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划到达日期"),
  1066. pr_rarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "需求到货日期"),
  1067. pr_rparrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "再计划到货日期"),
  1068. pr_pur_affirm_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购确认到货日期"),
  1069. pr_sysprice = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "系统价格(含税)"),
  1070. pr_orderprice = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单价格(含税)"),
  1071. pr_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购净价(不含税)"),
  1072. pr_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
  1073. pr_unit = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"),
  1074. state = table.Column<int>(type: "int", nullable: true, comment: "状态"),
  1075. old_apply_aqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已申请数量"),
  1076. pr_type = table.Column<int>(type: "int", nullable: true, comment: "申请类型"),
  1077. currencytype = table.Column<long>(type: "bigint", nullable: false, comment: "币种"),
  1078. secInv_ratio = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存触发采购比例"),
  1079. remark = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"),
  1080. pr_rreason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "拒绝原因"),
  1081. sentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
  1082. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1083. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  1084. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  1085. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1086. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  1087. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  1088. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1089. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1090. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1091. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  1092. },
  1093. constraints: table =>
  1094. {
  1095. table.PrimaryKey("PK_srm_pr_main", x => x.Id);
  1096. },
  1097. comment: "采购申请单");
  1098. migrationBuilder.CreateTable(
  1099. name: "srm_purchase",
  1100. columns: table => new
  1101. {
  1102. Id = table.Column<long>(type: "bigint", nullable: false),
  1103. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  1104. icitem_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
  1105. sourcelist_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "货源清单编号"),
  1106. supplier_id = table.Column<long>(type: "bigint", nullable: true, comment: "供应商id"),
  1107. supplier_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编码"),
  1108. supplier_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
  1109. purchgroup = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购组"),
  1110. purcher = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"),
  1111. purchase_unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购计量单位"),
  1112. netpurchase_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购净价(不含税)"),
  1113. taxrate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
  1114. currency_type = table.Column<long>(type: "bigint", nullable: true, comment: "币种"),
  1115. order_rector_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购负责人"),
  1116. order_rector_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购负责人_工号"),
  1117. factory_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工厂编码"),
  1118. order_dept = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购部门"),
  1119. order_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购单价"),
  1120. sale_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "销售单价"),
  1121. qty_min = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "最小订货量"),
  1122. batch_append_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "批量增量"),
  1123. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1124. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  1125. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  1126. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1127. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  1128. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  1129. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1130. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1131. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1132. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  1133. },
  1134. constraints: table =>
  1135. {
  1136. table.PrimaryKey("PK_srm_purchase", x => x.Id);
  1137. },
  1138. comment: "物料采购报价单");
  1139. migrationBuilder.CreateTable(
  1140. name: "srm_supplier",
  1141. columns: table => new
  1142. {
  1143. Id = table.Column<long>(type: "bigint", nullable: false),
  1144. supplier_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编号"),
  1145. supplier_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商名称"),
  1146. supplier_full_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商全称"),
  1147. supplier_help_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商助记码"),
  1148. supplier_short_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商简称"),
  1149. supplier_address = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商地址"),
  1150. state = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "状态"),
  1151. region = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "区域"),
  1152. trade = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "行业"),
  1153. contact = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系人"),
  1154. telephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系电话"),
  1155. mobile = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "移动电话"),
  1156. fax = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "传真号码"),
  1157. post_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮政编码"),
  1158. email = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮件地址"),
  1159. taxid = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "税务登记号"),
  1160. bank = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "开户银行"),
  1161. bank_account = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "银行账号"),
  1162. value_add_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "增值税率"),
  1163. type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商分类"),
  1164. po_mode = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购模式"),
  1165. vmi_stock = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "VMI仓"),
  1166. stockid_assignee = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "受托代销虚仓"),
  1167. branch_info = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "分支机构信息"),
  1168. regmark = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "注册商标"),
  1169. licence = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "营业执照"),
  1170. regster_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "注册日期"),
  1171. approve_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "批准日期"),
  1172. begin_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生效日期"),
  1173. end_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "失效日期"),
  1174. supply_grade = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商等级"),
  1175. supply_type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应类别"),
  1176. company_type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "公司类别"),
  1177. auto_create_mr = table.Column<bool>(type: "bit", nullable: true, comment: "交货自动生成收货单据"),
  1178. auto_validate_order = table.Column<bool>(type: "bit", nullable: true, comment: "自动确认订单"),
  1179. isuse_supplier_portal = table.Column<bool>(type: "bit", nullable: true, comment: "启用供应商门户"),
  1180. department = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "分管部门"),
  1181. employee_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员"),
  1182. employee_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号"),
  1183. currency = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算币种"),
  1184. settlement = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算方式"),
  1185. name_en = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "英文名称"),
  1186. addr_en = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "英文地址"),
  1187. country = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "国别地区"),
  1188. checker = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "审核人"),
  1189. op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
  1190. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1191. create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
  1192. create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
  1193. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1194. update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
  1195. update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
  1196. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1197. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1198. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1199. IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
  1200. },
  1201. constraints: table =>
  1202. {
  1203. table.PrimaryKey("PK_srm_supplier", x => x.Id);
  1204. },
  1205. comment: "供应商");
  1206. migrationBuilder.CreateIndex(
  1207. name: "IX_crm_customer_customer_no_tenant_id_factory_id",
  1208. table: "crm_customer",
  1209. columns: new[] { "customer_no", "tenant_id", "factory_id" });
  1210. migrationBuilder.CreateIndex(
  1211. name: "IX_crm_seorder_bill_no_tenant_id_factory_id",
  1212. table: "crm_seorder",
  1213. columns: new[] { "bill_no", "tenant_id", "factory_id" });
  1214. migrationBuilder.CreateIndex(
  1215. name: "IX_crm_seorderentry_seorder_id_bill_no_item_number_tenant_id_factory_id",
  1216. table: "crm_seorderentry",
  1217. columns: new[] { "seorder_id", "bill_no", "item_number", "tenant_id", "factory_id" });
  1218. migrationBuilder.CreateIndex(
  1219. name: "IX_ic_bom_bom_number_item_number_version_tenant_id_factory_id",
  1220. table: "ic_bom",
  1221. columns: new[] { "bom_number", "item_number", "version", "tenant_id", "factory_id" });
  1222. migrationBuilder.CreateIndex(
  1223. name: "IX_ic_bom_child_bom_id_bom_number_item_number_version_tenant_id_factory_id",
  1224. table: "ic_bom_child",
  1225. columns: new[] { "bom_id", "bom_number", "item_number", "version", "tenant_id", "factory_id" });
  1226. migrationBuilder.CreateIndex(
  1227. name: "IX_ic_item_number_name_tenant_id_factory_id",
  1228. table: "ic_item",
  1229. columns: new[] { "number", "name", "tenant_id", "factory_id" });
  1230. migrationBuilder.CreateIndex(
  1231. name: "IX_ic_item_inventory_stock_id_stock_place_id_tenant_id_factory_id",
  1232. table: "ic_item_inventory",
  1233. columns: new[] { "stock_id", "stock_place_id", "tenant_id", "factory_id" });
  1234. migrationBuilder.CreateIndex(
  1235. name: "IX_ic_item_stock_icitem_id_icitem_name_tenant_id_factory_id",
  1236. table: "ic_item_stock",
  1237. columns: new[] { "icitem_id", "icitem_name", "tenant_id", "factory_id" });
  1238. migrationBuilder.CreateIndex(
  1239. name: "IX_ic_substitute_substitute_code_tenant_id_factory_id",
  1240. table: "ic_substitute",
  1241. columns: new[] { "substitute_code", "tenant_id", "factory_id" });
  1242. migrationBuilder.CreateIndex(
  1243. name: "IX_ic_substitute_group_substitute_code_tenant_id_factory_id",
  1244. table: "ic_substitute_group",
  1245. columns: new[] { "substitute_code", "tenant_id", "factory_id" });
  1246. migrationBuilder.CreateIndex(
  1247. name: "IX_ic_substitute_group_detail_substitute_code_icitem_number_tenant_id_factory_id",
  1248. table: "ic_substitute_group_detail",
  1249. columns: new[] { "substitute_code", "icitem_number", "tenant_id", "factory_id" });
  1250. migrationBuilder.CreateIndex(
  1251. name: "IX_mes_moentry_moentry_moid_moentry_mono_tenant_id_factory_id",
  1252. table: "mes_moentry",
  1253. columns: new[] { "moentry_moid", "moentry_mono", "tenant_id", "factory_id" });
  1254. migrationBuilder.CreateIndex(
  1255. name: "IX_mes_mooccupy_moo_id_billid_tenant_id_factory_id",
  1256. table: "mes_mooccupy",
  1257. columns: new[] { "moo_id_billid", "tenant_id", "factory_id" });
  1258. migrationBuilder.CreateIndex(
  1259. name: "IX_mes_morder_morder_no_tenant_id_factory_id",
  1260. table: "mes_morder",
  1261. columns: new[] { "morder_no", "tenant_id", "factory_id" });
  1262. migrationBuilder.CreateIndex(
  1263. name: "IX_mes_stockoccupy_fbill_no_fitem_number_tenant_id_factory_id",
  1264. table: "mes_stockoccupy",
  1265. columns: new[] { "fbill_no", "fitem_number", "tenant_id", "factory_id" });
  1266. migrationBuilder.CreateIndex(
  1267. name: "IX_srm_po_list_po_billno_number_tenant_id_factory_id",
  1268. table: "srm_po_list",
  1269. columns: new[] { "po_billno", "number", "tenant_id", "factory_id" });
  1270. migrationBuilder.CreateIndex(
  1271. name: "IX_srm_po_main_po_billno_tenant_id_factory_id",
  1272. table: "srm_po_main",
  1273. columns: new[] { "po_billno", "tenant_id", "factory_id" });
  1274. migrationBuilder.CreateIndex(
  1275. name: "IX_srm_po_occupy_polist_id_tenant_id_factory_id",
  1276. table: "srm_po_occupy",
  1277. columns: new[] { "polist_id", "tenant_id", "factory_id" });
  1278. migrationBuilder.CreateIndex(
  1279. name: "IX_srm_pr_main_pr_billno_pr_purchasenumber_tenant_id_factory_id",
  1280. table: "srm_pr_main",
  1281. columns: new[] { "pr_billno", "pr_purchasenumber", "tenant_id", "factory_id" });
  1282. migrationBuilder.CreateIndex(
  1283. name: "IX_srm_purchase_icitem_id_supplier_number_tenant_id_factory_id",
  1284. table: "srm_purchase",
  1285. columns: new[] { "icitem_id", "supplier_number", "tenant_id", "factory_id" });
  1286. migrationBuilder.CreateIndex(
  1287. name: "IX_srm_supplier_supplier_no_tenant_id_factory_id",
  1288. table: "srm_supplier",
  1289. columns: new[] { "supplier_no", "tenant_id", "factory_id" });
  1290. }
  1291. protected override void Down(MigrationBuilder migrationBuilder)
  1292. {
  1293. migrationBuilder.DropTable(
  1294. name: "b_bom_pretreatment");
  1295. migrationBuilder.DropTable(
  1296. name: "crm_customer");
  1297. migrationBuilder.DropTable(
  1298. name: "crm_seorder");
  1299. migrationBuilder.DropTable(
  1300. name: "crm_seorderentry");
  1301. migrationBuilder.DropTable(
  1302. name: "ic_bom");
  1303. migrationBuilder.DropTable(
  1304. name: "ic_bom_child");
  1305. migrationBuilder.DropTable(
  1306. name: "ic_item");
  1307. migrationBuilder.DropTable(
  1308. name: "ic_item_inventory");
  1309. migrationBuilder.DropTable(
  1310. name: "ic_item_stock");
  1311. migrationBuilder.DropTable(
  1312. name: "ic_substitute");
  1313. migrationBuilder.DropTable(
  1314. name: "ic_substitute_group");
  1315. migrationBuilder.DropTable(
  1316. name: "ic_substitute_group_detail");
  1317. migrationBuilder.DropTable(
  1318. name: "mes_moentry");
  1319. migrationBuilder.DropTable(
  1320. name: "mes_mooccupy");
  1321. migrationBuilder.DropTable(
  1322. name: "mes_morder");
  1323. migrationBuilder.DropTable(
  1324. name: "mes_oorder");
  1325. migrationBuilder.DropTable(
  1326. name: "mes_process");
  1327. migrationBuilder.DropTable(
  1328. name: "mes_stockoccupy");
  1329. migrationBuilder.DropTable(
  1330. name: "mes_tech_process");
  1331. migrationBuilder.DropTable(
  1332. name: "mes_technique");
  1333. migrationBuilder.DropTable(
  1334. name: "mes_workshop");
  1335. migrationBuilder.DropTable(
  1336. name: "srm_po_list");
  1337. migrationBuilder.DropTable(
  1338. name: "srm_po_main");
  1339. migrationBuilder.DropTable(
  1340. name: "srm_po_occupy");
  1341. migrationBuilder.DropTable(
  1342. name: "srm_pr_main");
  1343. migrationBuilder.DropTable(
  1344. name: "srm_purchase");
  1345. migrationBuilder.DropTable(
  1346. name: "srm_supplier");
  1347. }
  1348. }
  1349. }