20240529145339_addCompanyIdAll.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class addCompanyIdAll : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<long>(
  12. name: "CompanyId",
  13. table: "UserTasks",
  14. type: "bigint",
  15. nullable: false,
  16. defaultValue: 0L);
  17. migrationBuilder.AddColumn<long>(
  18. name: "CompanyId",
  19. table: "Teams",
  20. type: "bigint",
  21. nullable: false,
  22. defaultValue: 0L);
  23. migrationBuilder.AddColumn<long>(
  24. name: "CompanyId",
  25. table: "Projects",
  26. type: "bigint",
  27. nullable: false,
  28. defaultValue: 0L);
  29. migrationBuilder.AddColumn<long>(
  30. name: "CompanyId",
  31. table: "OrderRequests",
  32. type: "bigint",
  33. nullable: false,
  34. defaultValue: 0L);
  35. migrationBuilder.AddColumn<long>(
  36. name: "CompanyId",
  37. table: "OrderAllocations",
  38. type: "bigint",
  39. nullable: false,
  40. defaultValue: 0L);
  41. migrationBuilder.AddColumn<long>(
  42. name: "CompanyId",
  43. table: "Meetings",
  44. type: "bigint",
  45. nullable: false,
  46. defaultValue: 0L);
  47. migrationBuilder.AddColumn<long>(
  48. name: "CompanyId",
  49. table: "Attendances",
  50. type: "bigint",
  51. nullable: false,
  52. defaultValue: 0L);
  53. migrationBuilder.CreateIndex(
  54. name: "IX_UserTasks_CompanyId",
  55. table: "UserTasks",
  56. column: "CompanyId");
  57. migrationBuilder.CreateIndex(
  58. name: "IX_Teams_CompanyId",
  59. table: "Teams",
  60. column: "CompanyId");
  61. migrationBuilder.CreateIndex(
  62. name: "IX_Projects_CompanyId",
  63. table: "Projects",
  64. column: "CompanyId");
  65. migrationBuilder.CreateIndex(
  66. name: "IX_OrderRequests_CompanyId",
  67. table: "OrderRequests",
  68. column: "CompanyId");
  69. migrationBuilder.CreateIndex(
  70. name: "IX_OrderAllocations_CompanyId",
  71. table: "OrderAllocations",
  72. column: "CompanyId");
  73. migrationBuilder.CreateIndex(
  74. name: "IX_Meetings_CompanyId",
  75. table: "Meetings",
  76. column: "CompanyId");
  77. migrationBuilder.CreateIndex(
  78. name: "IX_Attendances_CompanyId",
  79. table: "Attendances",
  80. column: "CompanyId");
  81. }
  82. /// <inheritdoc />
  83. protected override void Down(MigrationBuilder migrationBuilder)
  84. {
  85. migrationBuilder.DropIndex(
  86. name: "IX_UserTasks_CompanyId",
  87. table: "UserTasks");
  88. migrationBuilder.DropIndex(
  89. name: "IX_Teams_CompanyId",
  90. table: "Teams");
  91. migrationBuilder.DropIndex(
  92. name: "IX_Projects_CompanyId",
  93. table: "Projects");
  94. migrationBuilder.DropIndex(
  95. name: "IX_OrderRequests_CompanyId",
  96. table: "OrderRequests");
  97. migrationBuilder.DropIndex(
  98. name: "IX_OrderAllocations_CompanyId",
  99. table: "OrderAllocations");
  100. migrationBuilder.DropIndex(
  101. name: "IX_Meetings_CompanyId",
  102. table: "Meetings");
  103. migrationBuilder.DropIndex(
  104. name: "IX_Attendances_CompanyId",
  105. table: "Attendances");
  106. migrationBuilder.DropColumn(
  107. name: "CompanyId",
  108. table: "UserTasks");
  109. migrationBuilder.DropColumn(
  110. name: "CompanyId",
  111. table: "Teams");
  112. migrationBuilder.DropColumn(
  113. name: "CompanyId",
  114. table: "Projects");
  115. migrationBuilder.DropColumn(
  116. name: "CompanyId",
  117. table: "OrderRequests");
  118. migrationBuilder.DropColumn(
  119. name: "CompanyId",
  120. table: "OrderAllocations");
  121. migrationBuilder.DropColumn(
  122. name: "CompanyId",
  123. table: "Meetings");
  124. migrationBuilder.DropColumn(
  125. name: "CompanyId",
  126. table: "Attendances");
  127. }
  128. }
  129. }