Tournament management
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddTournamentTeam : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TournamentTeams",
|
||||
columns: table => new
|
||||
{
|
||||
TournamentId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
TeamId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Seed = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TournamentTeams", x => new { x.TournamentId, x.TeamId });
|
||||
table.ForeignKey(
|
||||
name: "FK_TournamentTeams_Teams_TeamId",
|
||||
column: x => x.TeamId,
|
||||
principalTable: "Teams",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TournamentTeams_Tournaments_TournamentId",
|
||||
column: x => x.TournamentId,
|
||||
principalTable: "Tournaments",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TournamentTeams_TeamId",
|
||||
table: "TournamentTeams",
|
||||
column: "TeamId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TournamentTeams");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user