| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace Diligent.WebAPI.Data.Migrations
- {
- public partial class ChangedCategoryEntity : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<int>(
- name: "ParentCategoryId",
- table: "Categories",
- type: "int",
- nullable: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Categories_ParentCategoryId",
- table: "Categories",
- column: "ParentCategoryId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Categories_Categories_ParentCategoryId",
- table: "Categories",
- column: "ParentCategoryId",
- principalTable: "Categories",
- principalColumn: "Id");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Categories_Categories_ParentCategoryId",
- table: "Categories");
-
- migrationBuilder.DropIndex(
- name: "IX_Categories_ParentCategoryId",
- table: "Categories");
-
- migrationBuilder.DropColumn(
- name: "ParentCategoryId",
- table: "Categories");
- }
- }
- }
|