feat: initial datamodel + ef connection and migrations
Initial version of the data model Includes EF initialization and migrations EF migrations are applied on application start
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TournamentOrganizer;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
[DbContext(typeof(TournamentContext))]
|
||||
[Migration("20260409072947_InitialEvent")]
|
||||
partial class InitialEvent
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EventEnd")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("EventStart")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialEvent : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Events",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
EventStart = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
EventEnd = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Events", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Events");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TournamentOrganizer;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
[DbContext(typeof(TournamentContext))]
|
||||
[Migration("20260409082427_InitialDataModel")]
|
||||
partial class InitialDataModel
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EventEnd")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("EventStart")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Games");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TournamentId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TournamentId");
|
||||
|
||||
b.ToTable("Matches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Contact")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("Players");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.Property<int>("RoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PlayerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RoundId", "PlayerId");
|
||||
|
||||
b.HasIndex("PlayerId");
|
||||
|
||||
b.ToTable("PlayerParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("WinnerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MatchId");
|
||||
|
||||
b.ToTable("Rounds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Seed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("MatchId", "TeamId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("TeamParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("EventId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.HasIndex("GameId");
|
||||
|
||||
b.ToTable("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Tournament", "Tournament")
|
||||
.WithMany()
|
||||
.HasForeignKey("TournamentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Tournament");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Players")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Player", "Player")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlayerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Round", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoundId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Player");
|
||||
|
||||
b.Navigation("Round");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Match")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Match");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Matches")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Round");
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Event", "Event")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("EventId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Game", "Game")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("GameId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Event");
|
||||
|
||||
b.Navigation("Game");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Navigation("Matches");
|
||||
|
||||
b.Navigation("Players");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialDataModel : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Games",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", nullable: false),
|
||||
S1RuleSet = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
S2RuleSet = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Games", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Teams",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Teams", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tournaments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GameId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
EventId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
S1RuleSet = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
S2RuleSet = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tournaments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tournaments_Events_EventId",
|
||||
column: x => x.EventId,
|
||||
principalTable: "Events",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tournaments_Games_GameId",
|
||||
column: x => x.GameId,
|
||||
principalTable: "Games",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Players",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Contact = table.Column<string>(type: "TEXT", nullable: false),
|
||||
TeamId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Players", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Players_Teams_TeamId",
|
||||
column: x => x.TeamId,
|
||||
principalTable: "Teams",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Matches",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
TournamentId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Matches", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Matches_Tournaments_TournamentId",
|
||||
column: x => x.TournamentId,
|
||||
principalTable: "Tournaments",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Rounds",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
MatchId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
WinnerId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
State = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Rounds", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Rounds_Matches_MatchId",
|
||||
column: x => x.MatchId,
|
||||
principalTable: "Matches",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TeamParticipants",
|
||||
columns: table => new
|
||||
{
|
||||
MatchId = 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_TeamParticipants", x => new { x.MatchId, x.TeamId });
|
||||
table.ForeignKey(
|
||||
name: "FK_TeamParticipants_Matches_MatchId",
|
||||
column: x => x.MatchId,
|
||||
principalTable: "Matches",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TeamParticipants_Teams_TeamId",
|
||||
column: x => x.TeamId,
|
||||
principalTable: "Teams",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlayerParticipants",
|
||||
columns: table => new
|
||||
{
|
||||
RoundId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
PlayerId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlayerParticipants", x => new { x.RoundId, x.PlayerId });
|
||||
table.ForeignKey(
|
||||
name: "FK_PlayerParticipants_Players_PlayerId",
|
||||
column: x => x.PlayerId,
|
||||
principalTable: "Players",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PlayerParticipants_Rounds_RoundId",
|
||||
column: x => x.RoundId,
|
||||
principalTable: "Rounds",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Matches_TournamentId",
|
||||
table: "Matches",
|
||||
column: "TournamentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlayerParticipants_PlayerId",
|
||||
table: "PlayerParticipants",
|
||||
column: "PlayerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Players_TeamId",
|
||||
table: "Players",
|
||||
column: "TeamId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Rounds_MatchId",
|
||||
table: "Rounds",
|
||||
column: "MatchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TeamParticipants_TeamId",
|
||||
table: "TeamParticipants",
|
||||
column: "TeamId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tournaments_EventId",
|
||||
table: "Tournaments",
|
||||
column: "EventId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tournaments_GameId",
|
||||
table: "Tournaments",
|
||||
column: "GameId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlayerParticipants");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TeamParticipants");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Players");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Rounds");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Teams");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Matches");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tournaments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Games");
|
||||
}
|
||||
}
|
||||
}
|
||||
+318
@@ -0,0 +1,318 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TournamentOrganizer;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
[DbContext(typeof(TournamentContext))]
|
||||
[Migration("20260409083011_TournamentStartEnd")]
|
||||
partial class TournamentStartEnd
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Games");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TournamentId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TournamentId");
|
||||
|
||||
b.ToTable("Matches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Contact")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("Players");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.Property<int>("RoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PlayerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RoundId", "PlayerId");
|
||||
|
||||
b.HasIndex("PlayerId");
|
||||
|
||||
b.ToTable("PlayerParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MatchId");
|
||||
|
||||
b.ToTable("Rounds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Seed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("MatchId", "TeamId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("TeamParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EventId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.HasIndex("GameId");
|
||||
|
||||
b.ToTable("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Tournament", "Tournament")
|
||||
.WithMany()
|
||||
.HasForeignKey("TournamentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Tournament");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Players")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Player", "Player")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlayerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Round", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoundId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Player");
|
||||
|
||||
b.Navigation("Round");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Match")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Match");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Matches")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Round");
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Event", "Event")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("EventId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Game", "Game")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("GameId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Event");
|
||||
|
||||
b.Navigation("Game");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Navigation("Matches");
|
||||
|
||||
b.Navigation("Players");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TournamentStartEnd : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WinnerId",
|
||||
table: "Rounds");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "EventStart",
|
||||
table: "Events",
|
||||
newName: "Start");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "EventEnd",
|
||||
table: "Events",
|
||||
newName: "End");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "End",
|
||||
table: "Tournaments",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Start",
|
||||
table: "Tournaments",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "End",
|
||||
table: "Tournaments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Start",
|
||||
table: "Tournaments");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Start",
|
||||
table: "Events",
|
||||
newName: "EventStart");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "End",
|
||||
table: "Events",
|
||||
newName: "EventEnd");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "WinnerId",
|
||||
table: "Rounds",
|
||||
type: "INTEGER",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+321
@@ -0,0 +1,321 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TournamentOrganizer;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
[DbContext(typeof(TournamentContext))]
|
||||
[Migration("20260409083129_TeamParticipantScore")]
|
||||
partial class TeamParticipantScore
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Games");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TournamentId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TournamentId");
|
||||
|
||||
b.ToTable("Matches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Contact")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("Players");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.Property<int>("RoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PlayerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RoundId", "PlayerId");
|
||||
|
||||
b.HasIndex("PlayerId");
|
||||
|
||||
b.ToTable("PlayerParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MatchId");
|
||||
|
||||
b.ToTable("Rounds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Score")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Seed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("MatchId", "TeamId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("TeamParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EventId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.HasIndex("GameId");
|
||||
|
||||
b.ToTable("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Tournament", "Tournament")
|
||||
.WithMany()
|
||||
.HasForeignKey("TournamentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Tournament");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Players")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Player", "Player")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlayerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Round", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoundId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Player");
|
||||
|
||||
b.Navigation("Round");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Match")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Match");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Matches")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Round");
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Event", "Event")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("EventId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Game", "Game")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("GameId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Event");
|
||||
|
||||
b.Navigation("Game");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Navigation("Matches");
|
||||
|
||||
b.Navigation("Players");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TeamParticipantScore : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Score",
|
||||
table: "TeamParticipants",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Score",
|
||||
table: "TeamParticipants");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TournamentOrganizer;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TournamentOrganizer.Migrations
|
||||
{
|
||||
[DbContext(typeof(TournamentContext))]
|
||||
partial class TournamentContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Games");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TournamentId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TournamentId");
|
||||
|
||||
b.ToTable("Matches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Contact")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("Players");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.Property<int>("RoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PlayerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RoundId", "PlayerId");
|
||||
|
||||
b.HasIndex("PlayerId");
|
||||
|
||||
b.ToTable("PlayerParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MatchId");
|
||||
|
||||
b.ToTable("Rounds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.Property<int>("MatchId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TeamId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Score")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Seed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("MatchId", "TeamId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("TeamParticipants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EventId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("S1RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("S2RuleSet")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.HasIndex("GameId");
|
||||
|
||||
b.ToTable("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Match", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Tournament", "Tournament")
|
||||
.WithMany()
|
||||
.HasForeignKey("TournamentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Tournament");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Player", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Players")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.PlayerParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Player", "Player")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlayerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Round", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoundId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Player");
|
||||
|
||||
b.Navigation("Round");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Round", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Match")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Match");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.TeamParticipant", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Match", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("MatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Team", "Team")
|
||||
.WithMany("Matches")
|
||||
.HasForeignKey("TeamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Round");
|
||||
|
||||
b.Navigation("Team");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Tournament", b =>
|
||||
{
|
||||
b.HasOne("TournamentOrganizer.Models.Event", "Event")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("EventId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("TournamentOrganizer.Models.Game", "Game")
|
||||
.WithMany("Tournaments")
|
||||
.HasForeignKey("GameId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Event");
|
||||
|
||||
b.Navigation("Game");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Event", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Game", b =>
|
||||
{
|
||||
b.Navigation("Tournaments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TournamentOrganizer.Models.Team", b =>
|
||||
{
|
||||
b.Navigation("Matches");
|
||||
|
||||
b.Navigation("Players");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user