Timothy Schenk
1363ddf8fe
Some checks failed
Build, Package and Push Images / preprocess (push) Successful in 2s
Build, Package and Push Images / build (push) Successful in 25s
Build, Package and Push Images / sbom-scan (push) Successful in 35s
Build, Package and Push Images / container-build (push) Failing after 56s
Build, Package and Push Images / container-sbom-scan (push) Has been skipped
Build, Package and Push Images / sonarqube (push) Successful in 1m20s
74 lines
2.2 KiB
C#
74 lines
2.2 KiB
C#
// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License.
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Server.DB.Migrations;
|
|
|
|
/// <inheritdoc />
|
|
public partial class VariousDeletionBehaviours : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Characters_Accounts_AccountId",
|
|
table: "Characters");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "GuildMemberId",
|
|
table: "Accounts",
|
|
type: "uuid",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Accounts_GuildMemberId",
|
|
table: "Accounts",
|
|
column: "GuildMemberId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Accounts_GuildMember_GuildMemberId",
|
|
table: "Accounts",
|
|
column: "GuildMemberId",
|
|
principalTable: "GuildMember",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Characters_Accounts_AccountId",
|
|
table: "Characters",
|
|
column: "AccountId",
|
|
principalTable: "Accounts",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Accounts_GuildMember_GuildMemberId",
|
|
table: "Accounts");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Characters_Accounts_AccountId",
|
|
table: "Characters");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Accounts_GuildMemberId",
|
|
table: "Accounts");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "GuildMemberId",
|
|
table: "Accounts");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Characters_Accounts_AccountId",
|
|
table: "Characters",
|
|
column: "AccountId",
|
|
principalTable: "Accounts",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
}
|