| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace Diligent.WebAPI.Data.Migrations
- {
- public partial class AddedSelectionProcess : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "SelectionLevels",
- columns: table => new
- {
- Id = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_SelectionLevels", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "SelectionProcesses",
- columns: table => new
- {
- Id = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Status = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Date = table.Column<DateTime>(type: "datetime2", nullable: true),
- Link = table.Column<string>(type: "nvarchar(max)", nullable: true),
- SchedulerId = table.Column<int>(type: "int", nullable: true),
- SelectionLevelId = table.Column<int>(type: "int", nullable: false),
- ApplicantId = table.Column<int>(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_SelectionProcesses", x => x.Id);
- table.ForeignKey(
- name: "FK_SelectionProcesses_AspNetUsers_SchedulerId",
- column: x => x.SchedulerId,
- principalTable: "AspNetUsers",
- principalColumn: "Id");
- table.ForeignKey(
- name: "FK_SelectionProcesses_SelectionLevels_SelectionLevelId",
- column: x => x.SelectionLevelId,
- principalTable: "SelectionLevels",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_SelectionProcesses_SchedulerId",
- table: "SelectionProcesses",
- column: "SchedulerId");
-
- migrationBuilder.CreateIndex(
- name: "IX_SelectionProcesses_SelectionLevelId",
- table: "SelectionProcesses",
- column: "SelectionLevelId");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "SelectionProcesses");
-
- migrationBuilder.DropTable(
- name: "SelectionLevels");
- }
- }
- }
|