fixed deleting users
This commit is contained in:
parent
2246624917
commit
300ab2370f
10 changed files with 815 additions and 14 deletions
92
Lieb/Migrations/20221203143537_RaidOwnerNullable.cs
Normal file
92
Lieb/Migrations/20221203143537_RaidOwnerNullable.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue