Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

20230223130059_ChangedCategoryEntity.cs 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Diligent.WebAPI.Data.Migrations
  4. {
  5. public partial class ChangedCategoryEntity : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.AddColumn<int>(
  10. name: "ParentCategoryId",
  11. table: "Categories",
  12. type: "int",
  13. nullable: true);
  14. migrationBuilder.CreateIndex(
  15. name: "IX_Categories_ParentCategoryId",
  16. table: "Categories",
  17. column: "ParentCategoryId");
  18. migrationBuilder.AddForeignKey(
  19. name: "FK_Categories_Categories_ParentCategoryId",
  20. table: "Categories",
  21. column: "ParentCategoryId",
  22. principalTable: "Categories",
  23. principalColumn: "Id");
  24. }
  25. protected override void Down(MigrationBuilder migrationBuilder)
  26. {
  27. migrationBuilder.DropForeignKey(
  28. name: "FK_Categories_Categories_ParentCategoryId",
  29. table: "Categories");
  30. migrationBuilder.DropIndex(
  31. name: "IX_Categories_ParentCategoryId",
  32. table: "Categories");
  33. migrationBuilder.DropColumn(
  34. name: "ParentCategoryId",
  35. table: "Categories");
  36. }
  37. }
  38. }