using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Nuuru.Server.Migrations
{
///
public partial class AddThreadLastPostId : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "LastPostId",
table: "ForumThreads",
type: "INTEGER",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_ForumThreads_LastPostId",
table: "ForumThreads",
column: "LastPostId");
migrationBuilder.AddForeignKey(
name: "FK_ForumThreads_ForumPosts_LastPostId",
table: "ForumThreads",
column: "LastPostId",
principalTable: "ForumPosts",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ForumThreads_ForumPosts_LastPostId",
table: "ForumThreads");
migrationBuilder.DropIndex(
name: "IX_ForumThreads_LastPostId",
table: "ForumThreads");
migrationBuilder.DropColumn(
name: "LastPostId",
table: "ForumThreads");
}
}
}