20211202034338_workflow-modify.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace wispro.sp.api.Migrations
  4. {
  5. public partial class workflowmodify : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.AddColumn<DateTime>(
  10. name: "CreateTime",
  11. table: "Workflow",
  12. type: "datetime2",
  13. nullable: false,
  14. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
  15. migrationBuilder.AddColumn<int>(
  16. name: "CreateUserId",
  17. table: "Workflow",
  18. type: "int",
  19. nullable: false,
  20. defaultValue: 0);
  21. migrationBuilder.AddColumn<DateTime>(
  22. name: "EffectivrDate",
  23. table: "Workflow",
  24. type: "datetime2",
  25. nullable: false,
  26. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
  27. migrationBuilder.AddColumn<DateTime>(
  28. name: "ExpirationDate",
  29. table: "Workflow",
  30. type: "datetime2",
  31. nullable: false,
  32. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
  33. migrationBuilder.AddColumn<string>(
  34. name: "Memo",
  35. table: "Workflow",
  36. type: "nvarchar(max)",
  37. nullable: true);
  38. migrationBuilder.AlterColumn<string>(
  39. name: "DoItemMemo",
  40. table: "PerformanceItem",
  41. type: "nvarchar(max)",
  42. nullable: true,
  43. oldClrType: typeof(string),
  44. oldType: "nvarchar(500)",
  45. oldMaxLength: 500,
  46. oldNullable: true);
  47. migrationBuilder.InsertData(
  48. table: "BasePointRule",
  49. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  50. values: new object[] { 138, "0.2", 85, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)", "OA" });
  51. migrationBuilder.InsertData(
  52. table: "BasePointRule",
  53. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  54. values: new object[] { 139, "0.5", 84, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)", "OA" });
  55. migrationBuilder.InsertData(
  56. table: "BasePointRule",
  57. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  58. values: new object[] { 140, "0.3", 83, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\"  && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)", "OA" });
  59. migrationBuilder.CreateIndex(
  60. name: "IX_Workflow_CreateUserId",
  61. table: "Workflow",
  62. column: "CreateUserId");
  63. migrationBuilder.AddForeignKey(
  64. name: "FK_Workflow_Staff_CreateUserId",
  65. table: "Workflow",
  66. column: "CreateUserId",
  67. principalTable: "Staff",
  68. principalColumn: "Id",
  69. onDelete: ReferentialAction.Cascade);
  70. }
  71. protected override void Down(MigrationBuilder migrationBuilder)
  72. {
  73. migrationBuilder.DropForeignKey(
  74. name: "FK_Workflow_Staff_CreateUserId",
  75. table: "Workflow");
  76. migrationBuilder.DropIndex(
  77. name: "IX_Workflow_CreateUserId",
  78. table: "Workflow");
  79. migrationBuilder.DeleteData(
  80. table: "BasePointRule",
  81. keyColumn: "Id",
  82. keyValue: 138);
  83. migrationBuilder.DeleteData(
  84. table: "BasePointRule",
  85. keyColumn: "Id",
  86. keyValue: 139);
  87. migrationBuilder.DeleteData(
  88. table: "BasePointRule",
  89. keyColumn: "Id",
  90. keyValue: 140);
  91. migrationBuilder.DropColumn(
  92. name: "CreateTime",
  93. table: "Workflow");
  94. migrationBuilder.DropColumn(
  95. name: "CreateUserId",
  96. table: "Workflow");
  97. migrationBuilder.DropColumn(
  98. name: "EffectivrDate",
  99. table: "Workflow");
  100. migrationBuilder.DropColumn(
  101. name: "ExpirationDate",
  102. table: "Workflow");
  103. migrationBuilder.DropColumn(
  104. name: "Memo",
  105. table: "Workflow");
  106. migrationBuilder.AlterColumn<string>(
  107. name: "DoItemMemo",
  108. table: "PerformanceItem",
  109. type: "nvarchar(500)",
  110. maxLength: 500,
  111. nullable: true,
  112. oldClrType: typeof(string),
  113. oldType: "nvarchar(max)",
  114. oldNullable: true);
  115. }
  116. }
  117. }