Files

50 lines
1.4 KiB
C#
Raw Permalink Normal View History

2026-05-06 09:02:00 +02:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TournamentOrganizer.Migrations
{
/// <inheritdoc />
public partial class AddTeamLeader : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "LeaderId",
table: "Teams",
type: "INTEGER",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Teams_LeaderId",
table: "Teams",
column: "LeaderId");
migrationBuilder.AddForeignKey(
name: "FK_Teams_Players_LeaderId",
table: "Teams",
column: "LeaderId",
principalTable: "Players",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Teams_Players_LeaderId",
table: "Teams");
migrationBuilder.DropIndex(
name: "IX_Teams_LeaderId",
table: "Teams");
migrationBuilder.DropColumn(
name: "LeaderId",
table: "Teams");
}
}
}