Add linked suggestions with synced voting
This commit is contained in:
49
Data/Migrations/20260205075456_AddSuggestionLinks.cs
Normal file
49
Data/Migrations/20260205075456_AddSuggestionLinks.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GameList.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSuggestionLinks : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user