Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

20221107163821_AddedSelectionProcess.cs 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Diligent.WebAPI.Data.Migrations
  5. {
  6. public partial class AddedSelectionProcess : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "SelectionLevels",
  12. columns: table => new
  13. {
  14. Id = table.Column<int>(type: "int", nullable: false)
  15. .Annotation("SqlServer:Identity", "1, 1"),
  16. Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
  17. },
  18. constraints: table =>
  19. {
  20. table.PrimaryKey("PK_SelectionLevels", x => x.Id);
  21. });
  22. migrationBuilder.CreateTable(
  23. name: "SelectionProcesses",
  24. columns: table => new
  25. {
  26. Id = table.Column<int>(type: "int", nullable: false)
  27. .Annotation("SqlServer:Identity", "1, 1"),
  28. Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
  29. Status = table.Column<string>(type: "nvarchar(max)", nullable: false),
  30. Date = table.Column<DateTime>(type: "datetime2", nullable: true),
  31. Link = table.Column<string>(type: "nvarchar(max)", nullable: true),
  32. SchedulerId = table.Column<int>(type: "int", nullable: true),
  33. SelectionLevelId = table.Column<int>(type: "int", nullable: false),
  34. ApplicantId = table.Column<int>(type: "int", nullable: false)
  35. },
  36. constraints: table =>
  37. {
  38. table.PrimaryKey("PK_SelectionProcesses", x => x.Id);
  39. table.ForeignKey(
  40. name: "FK_SelectionProcesses_AspNetUsers_SchedulerId",
  41. column: x => x.SchedulerId,
  42. principalTable: "AspNetUsers",
  43. principalColumn: "Id");
  44. table.ForeignKey(
  45. name: "FK_SelectionProcesses_SelectionLevels_SelectionLevelId",
  46. column: x => x.SelectionLevelId,
  47. principalTable: "SelectionLevels",
  48. principalColumn: "Id",
  49. onDelete: ReferentialAction.Cascade);
  50. });
  51. migrationBuilder.CreateIndex(
  52. name: "IX_SelectionProcesses_SchedulerId",
  53. table: "SelectionProcesses",
  54. column: "SchedulerId");
  55. migrationBuilder.CreateIndex(
  56. name: "IX_SelectionProcesses_SelectionLevelId",
  57. table: "SelectionProcesses",
  58. column: "SelectionLevelId");
  59. }
  60. protected override void Down(MigrationBuilder migrationBuilder)
  61. {
  62. migrationBuilder.DropTable(
  63. name: "SelectionProcesses");
  64. migrationBuilder.DropTable(
  65. name: "SelectionLevels");
  66. }
  67. }
  68. }