Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Diligent.WebAPI.Data.Migrations
  5. {
  6. public partial class AddedComment : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "Comments",
  12. columns: table => new
  13. {
  14. Id = table.Column<int>(type: "int", nullable: false)
  15. .Annotation("SqlServer:Identity", "1, 1"),
  16. Content = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: false),
  17. DateOfSending = table.Column<DateTime>(type: "datetime2", nullable: false),
  18. UserId = table.Column<int>(type: "int", nullable: false),
  19. ApplicantId = table.Column<int>(type: "int", nullable: false)
  20. },
  21. constraints: table =>
  22. {
  23. table.PrimaryKey("PK_Comments", x => x.Id);
  24. table.ForeignKey(
  25. name: "FK_Comments_Applicants_ApplicantId",
  26. column: x => x.ApplicantId,
  27. principalTable: "Applicants",
  28. principalColumn: "ApplicantId",
  29. onDelete: ReferentialAction.Cascade);
  30. table.ForeignKey(
  31. name: "FK_Comments_AspNetUsers_UserId",
  32. column: x => x.UserId,
  33. principalTable: "AspNetUsers",
  34. principalColumn: "Id",
  35. onDelete: ReferentialAction.Cascade);
  36. });
  37. migrationBuilder.CreateIndex(
  38. name: "IX_Comments_ApplicantId",
  39. table: "Comments",
  40. column: "ApplicantId");
  41. migrationBuilder.CreateIndex(
  42. name: "IX_Comments_UserId",
  43. table: "Comments",
  44. column: "UserId");
  45. }
  46. protected override void Down(MigrationBuilder migrationBuilder)
  47. {
  48. migrationBuilder.DropTable(
  49. name: "Comments");
  50. }
  51. }
  52. }