fixed deleting users

This commit is contained in:
Sarah Faey 2022-12-03 16:24:06 +01:00
parent 2246624917
commit 300ab2370f
10 changed files with 815 additions and 14 deletions

View file

@ -0,0 +1,92 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lieb.Migrations
{
public partial class RaidOwnerNullable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RaidLog_LiebUser_UserId",
table: "RaidLog");
migrationBuilder.AlterColumn<ulong>(
name: "RaidOwnerId",
table: "RaidTemplate",
type: "INTEGER",
nullable: true,
oldClrType: typeof(ulong),
oldType: "INTEGER");
migrationBuilder.AlterColumn<ulong>(
name: "UserId",
table: "RaidLog",
type: "INTEGER",
nullable: true,
oldClrType: typeof(ulong),
oldType: "INTEGER");
migrationBuilder.AlterColumn<ulong>(
name: "RaidOwnerId",
table: "Raid",
type: "INTEGER",
nullable: true,
oldClrType: typeof(ulong),
oldType: "INTEGER");
migrationBuilder.AddForeignKey(
name: "FK_RaidLog_LiebUser_UserId",
table: "RaidLog",
column: "UserId",
principalTable: "LiebUser",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RaidLog_LiebUser_UserId",
table: "RaidLog");
migrationBuilder.AlterColumn<ulong>(
name: "RaidOwnerId",
table: "RaidTemplate",
type: "INTEGER",
nullable: false,
defaultValue: 0ul,
oldClrType: typeof(ulong),
oldType: "INTEGER",
oldNullable: true);
migrationBuilder.AlterColumn<ulong>(
name: "UserId",
table: "RaidLog",
type: "INTEGER",
nullable: false,
defaultValue: 0ul,
oldClrType: typeof(ulong),
oldType: "INTEGER",
oldNullable: true);
migrationBuilder.AlterColumn<ulong>(
name: "RaidOwnerId",
table: "Raid",
type: "INTEGER",
nullable: false,
defaultValue: 0ul,
oldClrType: typeof(ulong),
oldType: "INTEGER",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_RaidLog_LiebUser_UserId",
table: "RaidLog",
column: "UserId",
principalTable: "LiebUser",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}