using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Nuuru.Server.Migrations
{
///
public partial class AddBanAppeals : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "AppealsDenied",
table: "Bans",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "BanAppeals",
columns: table => new
{
Id = table.Column(type: "TEXT", nullable: false),
BanId = table.Column(type: "TEXT", nullable: false),
UserId = table.Column(type: "TEXT", nullable: false),
Reason = table.Column(type: "TEXT", maxLength: 4000, nullable: false),
Status = table.Column(type: "INTEGER", nullable: false),
CreatedAt = table.Column(type: "TEXT", nullable: false),
ResolvedAt = table.Column(type: "TEXT", nullable: true),
ModeratorNote = table.Column(type: "TEXT", maxLength: 2000, nullable: true),
ModeratorId = table.Column(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BanAppeals", x => x.Id);
table.ForeignKey(
name: "FK_BanAppeals_AspNetUsers_ModeratorId",
column: x => x.ModeratorId,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_BanAppeals_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BanAppeals_Bans_BanId",
column: x => x.BanId,
principalTable: "Bans",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_BanAppeals_BanId",
table: "BanAppeals",
column: "BanId");
migrationBuilder.CreateIndex(
name: "IX_BanAppeals_ModeratorId",
table: "BanAppeals",
column: "ModeratorId");
migrationBuilder.CreateIndex(
name: "IX_BanAppeals_UserId",
table: "BanAppeals",
column: "UserId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BanAppeals");
migrationBuilder.DropColumn(
name: "AppealsDenied",
table: "Bans");
}
}
}