Files
reallife-gamemode/ReallifeGamemode.Database/Migrations/20210420165544_Surgery.cs
2021-04-22 22:24:27 +02:00

111 lines
3.7 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Database.Migrations
{
public partial class Surgery : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs");
migrationBuilder.AddColumn<bool>(
name: "FreeSurgery",
table: "Users",
nullable: false,
defaultValue: false);
migrationBuilder.AlterColumn<int>(
name: "UserId",
table: "ChatLogs",
nullable: false,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs",
column: "UserId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs",
column: "FactionId",
principalTable: "Factions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs",
column: "GroupId",
principalTable: "Groups",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs");
migrationBuilder.DropColumn(
name: "FreeSurgery",
table: "Users");
migrationBuilder.AlterColumn<int>(
name: "UserId",
table: "ChatLogs",
type: "int",
nullable: true,
oldClrType: typeof(int));
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs",
column: "UserId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs",
column: "FactionId",
principalTable: "Factions",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs",
column: "GroupId",
principalTable: "Groups",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}