You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20221125142733_AddedPattern.cs 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Diligent.WebAPI.Data.Migrations
  5. {
  6. public partial class AddedPattern : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "Patterns",
  12. columns: table => new
  13. {
  14. Id = table.Column<int>(type: "int", nullable: false)
  15. .Annotation("SqlServer:Identity", "1, 1"),
  16. Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
  17. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
  18. SelectionLevelId = table.Column<int>(type: "int", nullable: false),
  19. Message = table.Column<string>(type: "nvarchar(max)", nullable: false)
  20. },
  21. constraints: table =>
  22. {
  23. table.PrimaryKey("PK_Patterns", x => x.Id);
  24. table.ForeignKey(
  25. name: "FK_Patterns_SelectionLevels_SelectionLevelId",
  26. column: x => x.SelectionLevelId,
  27. principalTable: "SelectionLevels",
  28. principalColumn: "Id",
  29. onDelete: ReferentialAction.Cascade);
  30. });
  31. migrationBuilder.CreateIndex(
  32. name: "IX_Patterns_SelectionLevelId",
  33. table: "Patterns",
  34. column: "SelectionLevelId");
  35. }
  36. protected override void Down(MigrationBuilder migrationBuilder)
  37. {
  38. migrationBuilder.DropTable(
  39. name: "Patterns");
  40. }
  41. }
  42. }