fix: fixed model issues

Game and Tournament forgot to add setters to group count and advancement numbers to stage 1 in multistage tournaments

Participant apparently accidentally deleted the composite key in TeamParticipant
This commit is contained in:
2026-04-09 12:08:52 +02:00
parent 929dc09274
commit f7aacdad04
8 changed files with 434 additions and 5 deletions
+21
View File
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Debugger (launch)",
"type": "coreclr",
"request": "launch",
"program": "${command:dotrush.activeTargetPath}",
"preLaunchTask": "dotrush: Build"
},
{
"name": ".NET Core Debugger (attach)",
"type": "coreclr",
"request": "attach",
"processId": "${command:dotrush.pickProcess}"
}
]
}
+5
View File
@@ -0,0 +1,5 @@
{
"dotrush.roslyn.projectOrSolutionFiles": [
"/home/shield/git/upce/bcsh1/TournamentOrganizer/TournamentOrganizer.sln"
]
}
@@ -0,0 +1,333 @@
// <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("20260409100559_FixS1Customizers")]
partial class FixS1Customizers
{
/// <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?>("S1GroupAdvances")
.HasColumnType("INTEGER");
b.Property<int?>("S1Groups")
.HasColumnType("INTEGER");
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?>("S1GroupAdvances")
.HasColumnType("INTEGER");
b.Property<int?>("S1Groups")
.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,58 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TournamentOrganizer.Migrations
{
/// <inheritdoc />
public partial class FixS1Customizers : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "S1GroupAdvances",
table: "Tournaments",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "S1Groups",
table: "Tournaments",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "S1GroupAdvances",
table: "Games",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "S1Groups",
table: "Games",
type: "INTEGER",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "S1GroupAdvances",
table: "Tournaments");
migrationBuilder.DropColumn(
name: "S1Groups",
table: "Tournaments");
migrationBuilder.DropColumn(
name: "S1GroupAdvances",
table: "Games");
migrationBuilder.DropColumn(
name: "S1Groups",
table: "Games");
}
}
}
@@ -52,6 +52,12 @@ namespace TournamentOrganizer.Migrations
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<int?>("S1GroupAdvances")
.HasColumnType("INTEGER");
b.Property<int?>("S1Groups")
.HasColumnType("INTEGER");
b.Property<int>("S1RuleSet") b.Property<int>("S1RuleSet")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
@@ -188,6 +194,12 @@ namespace TournamentOrganizer.Migrations
b.Property<int>("GameId") b.Property<int>("GameId")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<int?>("S1GroupAdvances")
.HasColumnType("INTEGER");
b.Property<int?>("S1Groups")
.HasColumnType("INTEGER");
b.Property<int>("S1RuleSet") b.Property<int>("S1RuleSet")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
+2 -2
View File
@@ -22,8 +22,8 @@ public class Game
public string Description { get; set; } = "Example Game Description"; public string Description { get; set; } = "Example Game Description";
public RuleSet S1RuleSet { get; set; } public RuleSet S1RuleSet { get; set; }
public int S1Groups; public int? S1Groups { get; set; }
public int S1GroupAdvances; public int? S1GroupAdvances { get; set; }
public RuleSet? S2RuleSet { get; set; } public RuleSet? S2RuleSet { get; set; }
+1 -1
View File
@@ -16,7 +16,7 @@ public class PlayerParticipant
public required Round Round { get; set; } public required Round Round { get; set; }
} }
[PrimaryKey(nameof(MatchId), nameof(TeamId))]
public class TeamParticipant public class TeamParticipant
{ {
public int MatchId { get; set; } public int MatchId { get; set; }
+2 -2
View File
@@ -17,8 +17,8 @@ public class Tournament
public DateTime End { get; set; } public DateTime End { get; set; }
public RuleSet S1RuleSet { get; set; } public RuleSet S1RuleSet { get; set; }
public int S1Groups; public int? S1Groups { get; set; }
public int S1GroupAdvances; public int? S1GroupAdvances { get; set; }
public RuleSet? S2RuleSet { get; set; } public RuleSet? S2RuleSet { get; set; }
public required Game Game { get; set; } public required Game Game { get; set; }