Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

20221110114417_AddedManyToManyBetweenAdAndApplicant.cs 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Diligent.WebAPI.Data.Migrations
  4. {
  5. public partial class AddedManyToManyBetweenAdAndApplicant : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "AdApplicant",
  11. columns: table => new
  12. {
  13. AdsId = table.Column<int>(type: "int", nullable: false),
  14. ApplicantsApplicantId = table.Column<int>(type: "int", nullable: false)
  15. },
  16. constraints: table =>
  17. {
  18. table.PrimaryKey("PK_AdApplicant", x => new { x.AdsId, x.ApplicantsApplicantId });
  19. table.ForeignKey(
  20. name: "FK_AdApplicant_Ads_AdsId",
  21. column: x => x.AdsId,
  22. principalTable: "Ads",
  23. principalColumn: "Id",
  24. onDelete: ReferentialAction.Cascade);
  25. table.ForeignKey(
  26. name: "FK_AdApplicant_Applicants_ApplicantsApplicantId",
  27. column: x => x.ApplicantsApplicantId,
  28. principalTable: "Applicants",
  29. principalColumn: "ApplicantId",
  30. onDelete: ReferentialAction.Cascade);
  31. });
  32. migrationBuilder.CreateIndex(
  33. name: "IX_AdApplicant_ApplicantsApplicantId",
  34. table: "AdApplicant",
  35. column: "ApplicantsApplicantId");
  36. }
  37. protected override void Down(MigrationBuilder migrationBuilder)
  38. {
  39. migrationBuilder.DropTable(
  40. name: "AdApplicant");
  41. }
  42. }
  43. }