using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Nuuru.Server.Migrations
{
///
public partial class AddBannerToBan : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "ApplicationUserId",
table: "Bans",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn(
name: "BannedById",
table: "Bans",
type: "TEXT",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Bans_ApplicationUserId",
table: "Bans",
column: "ApplicationUserId");
migrationBuilder.CreateIndex(
name: "IX_Bans_BannedById",
table: "Bans",
column: "BannedById");
migrationBuilder.AddForeignKey(
name: "FK_Bans_AspNetUsers_ApplicationUserId",
table: "Bans",
column: "ApplicationUserId",
principalTable: "AspNetUsers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Bans_AspNetUsers_BannedById",
table: "Bans",
column: "BannedById",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Bans_AspNetUsers_ApplicationUserId",
table: "Bans");
migrationBuilder.DropForeignKey(
name: "FK_Bans_AspNetUsers_BannedById",
table: "Bans");
migrationBuilder.DropIndex(
name: "IX_Bans_ApplicationUserId",
table: "Bans");
migrationBuilder.DropIndex(
name: "IX_Bans_BannedById",
table: "Bans");
migrationBuilder.DropColumn(
name: "ApplicationUserId",
table: "Bans");
migrationBuilder.DropColumn(
name: "BannedById",
table: "Bans");
}
}
}