using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace GameList.Data.Migrations { /// public partial class AddSuggestionLinks : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ParentSuggestionId", table: "Suggestions", type: "INTEGER", nullable: true); migrationBuilder.CreateIndex( name: "IX_Suggestions_ParentSuggestionId", table: "Suggestions", column: "ParentSuggestionId"); migrationBuilder.AddForeignKey( name: "FK_Suggestions_Suggestions_ParentSuggestionId", table: "Suggestions", column: "ParentSuggestionId", principalTable: "Suggestions", principalColumn: "Id", onDelete: ReferentialAction.SetNull); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Suggestions_Suggestions_ParentSuggestionId", table: "Suggestions"); migrationBuilder.DropIndex( name: "IX_Suggestions_ParentSuggestionId", table: "Suggestions"); migrationBuilder.DropColumn( name: "ParentSuggestionId", table: "Suggestions"); } } }