20240507163614_altrUserRelation.cs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class altrUserRelation : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AlterColumn<long>(
  12. name: "UniversityId",
  13. table: "AspNetUsers",
  14. type: "bigint",
  15. nullable: true,
  16. oldClrType: typeof(int),
  17. oldType: "int",
  18. oldNullable: true);
  19. migrationBuilder.AlterColumn<long>(
  20. name: "QualificationId",
  21. table: "AspNetUsers",
  22. type: "bigint",
  23. nullable: true,
  24. oldClrType: typeof(int),
  25. oldType: "int",
  26. oldNullable: true);
  27. migrationBuilder.AlterColumn<long>(
  28. name: "JobTitleId",
  29. table: "AspNetUsers",
  30. type: "bigint",
  31. nullable: true,
  32. oldClrType: typeof(int),
  33. oldType: "int",
  34. oldNullable: true);
  35. migrationBuilder.AlterColumn<long>(
  36. name: "IndustryId",
  37. table: "AspNetUsers",
  38. type: "bigint",
  39. nullable: true,
  40. oldClrType: typeof(int),
  41. oldType: "int",
  42. oldNullable: true);
  43. migrationBuilder.AlterColumn<long>(
  44. name: "CountryId",
  45. table: "AspNetUsers",
  46. type: "bigint",
  47. nullable: true,
  48. oldClrType: typeof(int),
  49. oldType: "int",
  50. oldNullable: true);
  51. migrationBuilder.UpdateData(
  52. table: "AspNetUsers",
  53. keyColumn: "Id",
  54. keyValue: "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
  55. columns: new[] { "CountryId", "IndustryId", "JobTitleId", "QualificationId", "UniversityId" },
  56. values: new object[] { null, null, null, null, null });
  57. migrationBuilder.UpdateData(
  58. table: "AspNetUsers",
  59. keyColumn: "Id",
  60. keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  61. columns: new[] { "CountryId", "IndustryId", "JobTitleId", "QualificationId", "UniversityId" },
  62. values: new object[] { null, null, null, null, null });
  63. migrationBuilder.CreateIndex(
  64. name: "IX_AspNetUsers_CountryId",
  65. table: "AspNetUsers",
  66. column: "CountryId");
  67. migrationBuilder.CreateIndex(
  68. name: "IX_AspNetUsers_IndustryId",
  69. table: "AspNetUsers",
  70. column: "IndustryId");
  71. migrationBuilder.CreateIndex(
  72. name: "IX_AspNetUsers_JobTitleId",
  73. table: "AspNetUsers",
  74. column: "JobTitleId");
  75. migrationBuilder.CreateIndex(
  76. name: "IX_AspNetUsers_QualificationId",
  77. table: "AspNetUsers",
  78. column: "QualificationId");
  79. migrationBuilder.CreateIndex(
  80. name: "IX_AspNetUsers_UniversityId",
  81. table: "AspNetUsers",
  82. column: "UniversityId");
  83. migrationBuilder.AddForeignKey(
  84. name: "FK_AspNetUsers_CountryLookups_CountryId",
  85. table: "AspNetUsers",
  86. column: "CountryId",
  87. principalTable: "CountryLookups",
  88. principalColumn: "Id");
  89. migrationBuilder.AddForeignKey(
  90. name: "FK_AspNetUsers_Industries_IndustryId",
  91. table: "AspNetUsers",
  92. column: "IndustryId",
  93. principalTable: "Industries",
  94. principalColumn: "Id");
  95. migrationBuilder.AddForeignKey(
  96. name: "FK_AspNetUsers_JobTitles_JobTitleId",
  97. table: "AspNetUsers",
  98. column: "JobTitleId",
  99. principalTable: "JobTitles",
  100. principalColumn: "Id");
  101. migrationBuilder.AddForeignKey(
  102. name: "FK_AspNetUsers_Qualifications_QualificationId",
  103. table: "AspNetUsers",
  104. column: "QualificationId",
  105. principalTable: "Qualifications",
  106. principalColumn: "Id");
  107. migrationBuilder.AddForeignKey(
  108. name: "FK_AspNetUsers_Universities_UniversityId",
  109. table: "AspNetUsers",
  110. column: "UniversityId",
  111. principalTable: "Universities",
  112. principalColumn: "Id");
  113. }
  114. /// <inheritdoc />
  115. protected override void Down(MigrationBuilder migrationBuilder)
  116. {
  117. migrationBuilder.DropForeignKey(
  118. name: "FK_AspNetUsers_CountryLookups_CountryId",
  119. table: "AspNetUsers");
  120. migrationBuilder.DropForeignKey(
  121. name: "FK_AspNetUsers_Industries_IndustryId",
  122. table: "AspNetUsers");
  123. migrationBuilder.DropForeignKey(
  124. name: "FK_AspNetUsers_JobTitles_JobTitleId",
  125. table: "AspNetUsers");
  126. migrationBuilder.DropForeignKey(
  127. name: "FK_AspNetUsers_Qualifications_QualificationId",
  128. table: "AspNetUsers");
  129. migrationBuilder.DropForeignKey(
  130. name: "FK_AspNetUsers_Universities_UniversityId",
  131. table: "AspNetUsers");
  132. migrationBuilder.DropIndex(
  133. name: "IX_AspNetUsers_CountryId",
  134. table: "AspNetUsers");
  135. migrationBuilder.DropIndex(
  136. name: "IX_AspNetUsers_IndustryId",
  137. table: "AspNetUsers");
  138. migrationBuilder.DropIndex(
  139. name: "IX_AspNetUsers_JobTitleId",
  140. table: "AspNetUsers");
  141. migrationBuilder.DropIndex(
  142. name: "IX_AspNetUsers_QualificationId",
  143. table: "AspNetUsers");
  144. migrationBuilder.DropIndex(
  145. name: "IX_AspNetUsers_UniversityId",
  146. table: "AspNetUsers");
  147. migrationBuilder.AlterColumn<int>(
  148. name: "UniversityId",
  149. table: "AspNetUsers",
  150. type: "int",
  151. nullable: true,
  152. oldClrType: typeof(long),
  153. oldType: "bigint",
  154. oldNullable: true);
  155. migrationBuilder.AlterColumn<int>(
  156. name: "QualificationId",
  157. table: "AspNetUsers",
  158. type: "int",
  159. nullable: true,
  160. oldClrType: typeof(long),
  161. oldType: "bigint",
  162. oldNullable: true);
  163. migrationBuilder.AlterColumn<int>(
  164. name: "JobTitleId",
  165. table: "AspNetUsers",
  166. type: "int",
  167. nullable: true,
  168. oldClrType: typeof(long),
  169. oldType: "bigint",
  170. oldNullable: true);
  171. migrationBuilder.AlterColumn<int>(
  172. name: "IndustryId",
  173. table: "AspNetUsers",
  174. type: "int",
  175. nullable: true,
  176. oldClrType: typeof(long),
  177. oldType: "bigint",
  178. oldNullable: true);
  179. migrationBuilder.AlterColumn<int>(
  180. name: "CountryId",
  181. table: "AspNetUsers",
  182. type: "int",
  183. nullable: true,
  184. oldClrType: typeof(long),
  185. oldType: "bigint",
  186. oldNullable: true);
  187. migrationBuilder.UpdateData(
  188. table: "AspNetUsers",
  189. keyColumn: "Id",
  190. keyValue: "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
  191. columns: new[] { "CountryId", "IndustryId", "JobTitleId", "QualificationId", "UniversityId" },
  192. values: new object[] { null, null, null, 1, null });
  193. migrationBuilder.UpdateData(
  194. table: "AspNetUsers",
  195. keyColumn: "Id",
  196. keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  197. columns: new[] { "CountryId", "IndustryId", "JobTitleId", "QualificationId", "UniversityId" },
  198. values: new object[] { null, null, null, 1, null });
  199. }
  200. }
  201. }