using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Nuuru.Server.Migrations
{
///
public partial class AddPostTrashFields : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "IsTrashed",
table: "BooruPosts",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "TrashReason",
table: "BooruPosts",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn(
name: "TrashedAt",
table: "BooruPosts",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn(
name: "TrashedById",
table: "BooruPosts",
type: "TEXT",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_BooruPosts_IsTrashed",
table: "BooruPosts",
column: "IsTrashed");
migrationBuilder.CreateIndex(
name: "IX_BooruPosts_IsTrashed_TrashedAt",
table: "BooruPosts",
columns: new[] { "IsTrashed", "TrashedAt" });
migrationBuilder.CreateIndex(
name: "IX_BooruPosts_TrashedById",
table: "BooruPosts",
column: "TrashedById");
migrationBuilder.AddForeignKey(
name: "FK_BooruPosts_AspNetUsers_TrashedById",
table: "BooruPosts",
column: "TrashedById",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_BooruPosts_AspNetUsers_TrashedById",
table: "BooruPosts");
migrationBuilder.DropIndex(
name: "IX_BooruPosts_IsTrashed",
table: "BooruPosts");
migrationBuilder.DropIndex(
name: "IX_BooruPosts_IsTrashed_TrashedAt",
table: "BooruPosts");
migrationBuilder.DropIndex(
name: "IX_BooruPosts_TrashedById",
table: "BooruPosts");
migrationBuilder.DropColumn(
name: "IsTrashed",
table: "BooruPosts");
migrationBuilder.DropColumn(
name: "TrashReason",
table: "BooruPosts");
migrationBuilder.DropColumn(
name: "TrashedAt",
table: "BooruPosts");
migrationBuilder.DropColumn(
name: "TrashedById",
table: "BooruPosts");
}
}
}