| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace Diligent.WebAPI.Data.Migrations
- {
- public partial class AddedManyToManyBetweenAdAndApplicant : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AdApplicant",
- columns: table => new
- {
- AdsId = table.Column<int>(type: "int", nullable: false),
- ApplicantsApplicantId = table.Column<int>(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AdApplicant", x => new { x.AdsId, x.ApplicantsApplicantId });
- table.ForeignKey(
- name: "FK_AdApplicant_Ads_AdsId",
- column: x => x.AdsId,
- principalTable: "Ads",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_AdApplicant_Applicants_ApplicantsApplicantId",
- column: x => x.ApplicantsApplicantId,
- principalTable: "Applicants",
- principalColumn: "ApplicantId",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AdApplicant_ApplicantsApplicantId",
- table: "AdApplicant",
- column: "ApplicantsApplicantId");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "AdApplicant");
- }
- }
- }
|