using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Diligent.WebAPI.Data.Migrations { public partial class ChangedCategoryEntity : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( 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"); } } }