| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace Diligent.WebAPI.Data.Migrations
- {
- public partial class addedSelectionLevesAndProcesses : 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_Applicants_ApplicantId",
- column: x => x.ApplicantId,
- principalTable: "Applicants",
- principalColumn: "ApplicantId",
- onDelete: ReferentialAction.Cascade);
- 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.InsertData(
- table: "SelectionLevels",
- columns: new[] { "Id", "Name" },
- values: new object[,]
- {
- { 1, "HR intervju" },
- { 2, "Screening test" },
- { 3, "Tehnicki intervju" },
- { 4, "Konacna odluka" }
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_SelectionProcesses_ApplicantId",
- table: "SelectionProcesses",
- column: "ApplicantId");
-
- 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");
- }
- }
- }
|