From 33ddddda0a7378ab37067c7b2533dd85c5a6b526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Fri, 13 Jun 2025 21:26:13 +0200 Subject: [PATCH 01/11] Add new property 'HigherScoreLoses' --- ...rnamentComputationConfigurationEndpoint.cs | 1 + .../Mapping/Rules/TournamentMappingRule.cs | 1 + .../Models/ComputationConfigurationDto.cs | 2 ++ .../Tournament/ComputationConfiguration.cs | 3 ++ .../Tournament/TeamGroupStatistics.cs | 35 ++++++++++++++----- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs b/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs index d3c161b9..2a881d85 100644 --- a/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs +++ b/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs @@ -45,6 +45,7 @@ private static async Task Handle( MatchWonPoints = request.Configuration.MatchWonPoints, MatchDrawnPoints = request.Configuration.MatchDrawnPoints, MatchLostPoints = request.Configuration.MatchLostPoints, + HigherScoreLoses = request.Configuration.HigherScoreLoses, ComparisonModes = request.Configuration.ComparisonModes.ToList() }; diff --git a/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs index 18058715..9f6a1254 100644 --- a/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs +++ b/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs @@ -126,6 +126,7 @@ protected override TournamentDto Map(IMapper mapper, MappingContext context, Tou MatchWonPoints = source.ComputationConfiguration.MatchWonPoints, MatchDrawnPoints = source.ComputationConfiguration.MatchDrawnPoints, MatchLostPoints = source.ComputationConfiguration.MatchLostPoints, + HigherScoreLoses = source.ComputationConfiguration.HigherScoreLoses, ComparisonModes = source.ComputationConfiguration.ComparisonModes.ToArray() }, PresentationConfiguration = mapper.Map(source.PresentationConfiguration) diff --git a/src/Turnierplan.App/Models/ComputationConfigurationDto.cs b/src/Turnierplan.App/Models/ComputationConfigurationDto.cs index 83c568a6..dfb583b8 100644 --- a/src/Turnierplan.App/Models/ComputationConfigurationDto.cs +++ b/src/Turnierplan.App/Models/ComputationConfigurationDto.cs @@ -10,5 +10,7 @@ public sealed record ComputationConfigurationDto public required int MatchLostPoints { get; init; } + public required bool HigherScoreLoses { get; init; } + public required TeamComparisonMode[] ComparisonModes { get; init; } } diff --git a/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs b/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs index 8a803a25..71776170 100644 --- a/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs +++ b/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs @@ -21,6 +21,9 @@ public sealed record ComputationConfiguration [JsonPropertyName("l")] public int MatchLostPoints { get; set; } = 0; + [JsonPropertyName("r")] + public bool HigherScoreLoses { get; set; } = false; + [JsonPropertyName("cmp")] public List ComparisonModes { get; set; } = [..__defaultTeamComparisonModes]; } diff --git a/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs b/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs index 0c7d12de..63690d4f 100644 --- a/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs +++ b/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs @@ -36,20 +36,39 @@ internal void AddMatchOutcome(int scoreFor, int scoreAgainst, ComputationConfigu ScoreFor += scoreFor; ScoreAgainst += scoreAgainst; - if (scoreFor > scoreAgainst) - { - MatchesWon++; - Points += computationConfiguration.MatchWonPoints; - } - else if (scoreFor == scoreAgainst) + if (scoreFor == scoreAgainst) { MatchesDrawn++; Points += computationConfiguration.MatchDrawnPoints; + + return; + } + + if (computationConfiguration.HigherScoreLoses) + { + if (scoreFor > scoreAgainst) + { + MatchesLost++; + Points += computationConfiguration.MatchLostPoints; + } + else + { + MatchesWon++; + Points += computationConfiguration.MatchWonPoints; + } } else { - MatchesLost++; - Points += computationConfiguration.MatchLostPoints; + if (scoreFor > scoreAgainst) + { + MatchesWon++; + Points += computationConfiguration.MatchWonPoints; + } + else + { + MatchesLost++; + Points += computationConfiguration.MatchLostPoints; + } } } } From 6b3c51f14dc67aaf298fc4fc9791af41c755e0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Fri, 13 Jun 2025 21:26:59 +0200 Subject: [PATCH 02/11] Add DB migration --- ...613192644_Add_HigherScoreLoses.Designer.cs | 1108 +++++++++++++++++ .../20250613192644_Add_HigherScoreLoses.cs | 22 + .../TurnierplanContextModelSnapshot.cs | 6 +- 3 files changed, 1135 insertions(+), 1 deletion(-) create mode 100644 src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs create mode 100644 src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs diff --git a/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs new file mode 100644 index 00000000..0fcbf0ff --- /dev/null +++ b/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs @@ -0,0 +1,1108 @@ +// +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Turnierplan.Dal; + +#nullable disable + +namespace Turnierplan.Dal.Migrations +{ + [DbContext(typeof(TurnierplanContext))] + [Migration("20250613192644_Add_HigherScoreLoses")] + partial class Add_HigherScoreLoses + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.6") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(25) + .HasColumnType("character varying(25)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("SecretHash") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("ApiKeys", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKeyId") + .HasColumnType("bigint"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("character varying(150)"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ApiKeyId"); + + b.HasIndex("Timestamp"); + + b.ToTable("ApiKeyRequests", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Document.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Configuration") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerationCount") + .HasColumnType("integer"); + + b.Property("LastGeneration") + .HasColumnType("timestamp with time zone"); + + b.Property("LastModifiedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.HasIndex("TournamentId"); + + b.ToTable("Documents", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("Folders", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Image.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("character varying(5)"); + + b.Property("Height") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("ResourceIdentifier") + .HasColumnType("uuid"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Width") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.HasIndex("ResourceIdentifier") + .IsUnique(); + + b.ToTable("Images", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)"); + + b.Property("OwnerId") + .HasColumnType("uuid"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("Organizations", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Id") + .HasColumnType("integer"); + + b.Property("AlphabeticalId") + .HasColumnType("character(1)"); + + b.Property("DisplayName") + .HasMaxLength(25) + .HasColumnType("character varying(25)"); + + b.HasKey("TournamentId", "Id"); + + b.ToTable("Groups", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("TeamId") + .HasColumnType("integer"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.HasKey("TournamentId", "GroupId", "TeamId"); + + b.HasIndex("TournamentId", "TeamId"); + + b.ToTable("GroupParticipants", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Court") + .HasColumnType("smallint"); + + b.Property("FinalsRound") + .HasColumnType("integer"); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsCurrentlyPlaying") + .HasColumnType("boolean"); + + b.Property("Kickoff") + .HasColumnType("timestamp with time zone"); + + b.Property("OutcomeType") + .HasColumnType("integer"); + + b.Property("PlayoffPosition") + .HasColumnType("integer"); + + b.Property("ScoreA") + .HasColumnType("integer"); + + b.Property("ScoreB") + .HasColumnType("integer"); + + b.Property("TeamSelectorA") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TeamSelectorB") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.HasKey("TournamentId", "Id"); + + b.HasIndex("TournamentId", "GroupId"); + + b.ToTable("Matches", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Id") + .HasColumnType("integer"); + + b.Property("EntryFeePaidAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)"); + + b.Property("OutOfCompetition") + .HasColumnType("boolean"); + + b.HasKey("TournamentId", "Id"); + + b.ToTable("Teams", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FolderId") + .HasColumnType("bigint"); + + b.Property("IsMigrated") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("OrganizerLogoId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("PublicPageViews") + .HasColumnType("integer"); + + b.Property("SponsorBannerId") + .HasColumnType("bigint"); + + b.Property("SponsorLogoId") + .HasColumnType("bigint"); + + b.Property("VenueId") + .HasColumnType("bigint"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("FolderId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("OrganizerLogoId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.HasIndex("SponsorBannerId"); + + b.HasIndex("SponsorLogoId"); + + b.HasIndex("VenueId"); + + b.ToTable("Tournaments", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.User.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", "turnierplan"); + + b.HasData( + new + { + Id = new Guid("9da7acec-ed66-4698-a2d6-927c9ee3f83a"), + Name = "Administrator" + }); + }); + + modelBuilder.Entity("Turnierplan.Core.User.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EMail") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastPasswordChange") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("NormalizedEMail") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEMail") + .IsUnique(); + + b.ToTable("Users", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.PrimitiveCollection>("AddressDetails") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.PrimitiveCollection>("ExternalLinks") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("Venues", "turnierplan"); + }); + + modelBuilder.Entity("UserRoles", b => + { + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("RoleId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("ApiKeys") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b => + { + b.HasOne("Turnierplan.Core.ApiKey.ApiKey", "ApiKey") + .WithMany("Requests") + .HasForeignKey("ApiKeyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApiKey"); + }); + + modelBuilder.Entity("Turnierplan.Core.Document.Document", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", "Tournament") + .WithMany("Documents") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tournament"); + }); + + modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Folders") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.Image.Image", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Images") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => + { + b.HasOne("Turnierplan.Core.User.User", null) + .WithMany("Organizations") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", null) + .WithMany("Groups") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b => + { + b.HasOne("Turnierplan.Core.Tournament.Group", "Group") + .WithMany("Participants") + .HasForeignKey("TournamentId", "GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Turnierplan.Core.Tournament.Team", "Team") + .WithMany() + .HasForeignKey("TournamentId", "TeamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", null) + .WithMany("Matches") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Turnierplan.Core.Tournament.Group", "Group") + .WithMany() + .HasForeignKey("TournamentId", "GroupId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", null) + .WithMany("Teams") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => + { + b.HasOne("Turnierplan.Core.Folder.Folder", "Folder") + .WithMany("Tournaments") + .HasForeignKey("FolderId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Tournaments") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Turnierplan.Core.Image.Image", "OrganizerLogo") + .WithMany() + .HasForeignKey("OrganizerLogoId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Image.Image", "SponsorBanner") + .WithMany() + .HasForeignKey("SponsorBannerId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Image.Image", "SponsorLogo") + .WithMany() + .HasForeignKey("SponsorLogoId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Venue.Venue", "Venue") + .WithMany("Tournaments") + .HasForeignKey("VenueId") + .OnDelete(DeleteBehavior.SetNull); + + b.OwnsOne("Turnierplan.Core.Tournament.ComputationConfiguration", "ComputationConfiguration", b1 => + { + b1.Property("TournamentId") + .HasColumnType("bigint"); + + b1.PrimitiveCollection("ComparisonModes") + .IsRequired() + .HasColumnType("integer[]") + .HasAnnotation("Relational:JsonPropertyName", "cmp"); + + b1.Property("HigherScoreLoses") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "r"); + + b1.Property("MatchDrawnPoints") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "d"); + + b1.Property("MatchLostPoints") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "l"); + + b1.Property("MatchWonPoints") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "w"); + + b1.HasKey("TournamentId"); + + b1.ToTable("Tournaments", "turnierplan"); + + b1.ToJson("ComputationConfiguration"); + + b1.WithOwner() + .HasForeignKey("TournamentId"); + }); + + b.OwnsOne("Turnierplan.Core.Tournament.MatchPlanConfiguration", "MatchPlanConfiguration", b1 => + { + b1.Property("TournamentId") + .HasColumnType("bigint"); + + b1.HasKey("TournamentId"); + + b1.ToTable("Tournaments", "turnierplan"); + + b1.ToJson("MatchPlanConfiguration"); + + b1.WithOwner() + .HasForeignKey("TournamentId"); + + b1.OwnsOne("Turnierplan.Core.Tournament.FinalsRoundConfig", "FinalsRoundConfig", b2 => + { + b2.Property("MatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("EnableThirdPlacePlayoff") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "3rd"); + + b2.Property("FirstFinalsRoundOrder") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "fo"); + + b2.PrimitiveCollection>("TeamSelectors") + .HasColumnType("text[]") + .HasAnnotation("Relational:JsonPropertyName", "ts"); + + b2.HasKey("MatchPlanConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "fr"); + + b2.WithOwner() + .HasForeignKey("MatchPlanConfigurationTournamentId"); + + b2.OwnsMany("Turnierplan.Core.Tournament.AdditionalPlayoffConfig", "AdditionalPlayoffs", b3 => + { + b3.Property("FinalsRoundConfigMatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b3.Property("__synthesizedOrdinal") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + b3.Property("PlayoffPosition") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "p"); + + b3.Property("TeamSelectorA") + .IsRequired() + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "a"); + + b3.Property("TeamSelectorB") + .IsRequired() + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "b"); + + b3.HasKey("FinalsRoundConfigMatchPlanConfigurationTournamentId", "__synthesizedOrdinal"); + + b3.ToTable("Tournaments", "turnierplan"); + + b3.HasAnnotation("Relational:JsonPropertyName", "ap"); + + b3.WithOwner() + .HasForeignKey("FinalsRoundConfigMatchPlanConfigurationTournamentId"); + }); + + b2.Navigation("AdditionalPlayoffs"); + }); + + b1.OwnsOne("Turnierplan.Core.Tournament.GroupRoundConfig", "GroupRoundConfig", b2 => + { + b2.Property("MatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("GroupMatchOrder") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "o"); + + b2.Property("GroupPhaseRounds") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "r"); + + b2.HasKey("MatchPlanConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "gr"); + + b2.WithOwner() + .HasForeignKey("MatchPlanConfigurationTournamentId"); + }); + + b1.OwnsOne("Turnierplan.Core.Tournament.ScheduleConfig", "ScheduleConfig", b2 => + { + b2.Property("MatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("FinalsPhaseNumberOfCourts") + .HasColumnType("smallint") + .HasAnnotation("Relational:JsonPropertyName", "fc"); + + b2.Property("FinalsPhasePauseTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "fp"); + + b2.Property("FinalsPhasePlayTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "fd"); + + b2.Property("FirstMatchKickoff") + .HasColumnType("timestamp with time zone") + .HasAnnotation("Relational:JsonPropertyName", "f"); + + b2.Property("GroupPhaseNumberOfCourts") + .HasColumnType("smallint") + .HasAnnotation("Relational:JsonPropertyName", "gc"); + + b2.Property("GroupPhasePauseTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "gp"); + + b2.Property("GroupPhasePlayTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "gd"); + + b2.Property("PauseBetweenGroupAndFinalsPhase") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "p"); + + b2.HasKey("MatchPlanConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "sc"); + + b2.WithOwner() + .HasForeignKey("MatchPlanConfigurationTournamentId"); + }); + + b1.Navigation("FinalsRoundConfig"); + + b1.Navigation("GroupRoundConfig"); + + b1.Navigation("ScheduleConfig"); + }); + + b.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration", "PresentationConfiguration", b1 => + { + b1.Property("TournamentId") + .HasColumnType("bigint"); + + b1.Property("ShowOrganizerLogo") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "ol"); + + b1.Property("ShowResults") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "o"); + + b1.Property("ShowSponsorLogo") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "sl"); + + b1.HasKey("TournamentId"); + + b1.ToTable("Tournaments", "turnierplan"); + + b1.ToJson("PresentationConfiguration"); + + b1.WithOwner() + .HasForeignKey("TournamentId"); + + b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header1", b2 => + { + b2.Property("PresentationConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("Content") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "c"); + + b2.Property("CustomContent") + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "cc"); + + b2.HasKey("PresentationConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "h1"); + + b2.WithOwner() + .HasForeignKey("PresentationConfigurationTournamentId"); + }); + + b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header2", b2 => + { + b2.Property("PresentationConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("Content") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "c"); + + b2.Property("CustomContent") + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "cc"); + + b2.HasKey("PresentationConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "h2"); + + b2.WithOwner() + .HasForeignKey("PresentationConfigurationTournamentId"); + }); + + b1.Navigation("Header1") + .IsRequired(); + + b1.Navigation("Header2") + .IsRequired(); + }); + + b.Navigation("ComputationConfiguration") + .IsRequired(); + + b.Navigation("Folder"); + + b.Navigation("MatchPlanConfiguration"); + + b.Navigation("Organization"); + + b.Navigation("OrganizerLogo"); + + b.Navigation("PresentationConfiguration") + .IsRequired(); + + b.Navigation("SponsorBanner"); + + b.Navigation("SponsorLogo"); + + b.Navigation("Venue"); + }); + + modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Venues") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("UserRoles", b => + { + b.HasOne("Turnierplan.Core.User.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Turnierplan.Core.User.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => + { + b.Navigation("Requests"); + }); + + modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => + { + b.Navigation("Tournaments"); + }); + + modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => + { + b.Navigation("ApiKeys"); + + b.Navigation("Folders"); + + b.Navigation("Images"); + + b.Navigation("Tournaments"); + + b.Navigation("Venues"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => + { + b.Navigation("Participants"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => + { + b.Navigation("Documents"); + + b.Navigation("Groups"); + + b.Navigation("Matches"); + + b.Navigation("Teams"); + }); + + modelBuilder.Entity("Turnierplan.Core.User.User", b => + { + b.Navigation("Organizations"); + }); + + modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => + { + b.Navigation("Tournaments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs new file mode 100644 index 00000000..f88ce5d0 --- /dev/null +++ b/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Turnierplan.Dal.Migrations +{ + /// + public partial class Add_HigherScoreLoses : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs index ad6b2460..01896c79 100644 --- a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs +++ b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "9.0.1") + .HasAnnotation("ProductVersion", "9.0.6") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -746,6 +746,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer[]") .HasAnnotation("Relational:JsonPropertyName", "cmp"); + b1.Property("HigherScoreLoses") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "r"); + b1.Property("MatchDrawnPoints") .HasColumnType("integer") .HasAnnotation("Relational:JsonPropertyName", "d"); From a1c97e2d116e70c243f11bfc383373c97f2272d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 15 Jun 2025 17:03:29 +0200 Subject: [PATCH 03/11] del --- ...613192644_Add_HigherScoreLoses.Designer.cs | 1108 ----------------- .../20250613192644_Add_HigherScoreLoses.cs | 22 - 2 files changed, 1130 deletions(-) delete mode 100644 src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs delete mode 100644 src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs diff --git a/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs deleted file mode 100644 index 0fcbf0ff..00000000 --- a/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.Designer.cs +++ /dev/null @@ -1,1108 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Turnierplan.Dal; - -#nullable disable - -namespace Turnierplan.Dal.Migrations -{ - [DbContext(typeof(TurnierplanContext))] - [Migration("20250613192644_Add_HigherScoreLoses")] - partial class Add_HigherScoreLoses - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.6") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("ExpiryDate") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("character varying(25)"); - - b.Property("OrganizationId") - .HasColumnType("bigint"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.Property("SecretHash") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationId"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.ToTable("ApiKeys", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApiKeyId") - .HasColumnType("bigint"); - - b.Property("Path") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ApiKeyId"); - - b.HasIndex("Timestamp"); - - b.ToTable("ApiKeyRequests", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Document.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Configuration") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("GenerationCount") - .HasColumnType("integer"); - - b.Property("LastGeneration") - .HasColumnType("timestamp with time zone"); - - b.Property("LastModifiedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.Property("TournamentId") - .HasColumnType("bigint"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.HasIndex("TournamentId"); - - b.ToTable("Documents", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("OrganizationId") - .HasColumnType("bigint"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationId"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.ToTable("Folders", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Image.Image", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("character varying(5)"); - - b.Property("Height") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("OrganizationId") - .HasColumnType("bigint"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.Property("ResourceIdentifier") - .HasColumnType("uuid"); - - b.Property("Type") - .HasColumnType("integer"); - - b.Property("Width") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationId"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.HasIndex("ResourceIdentifier") - .IsUnique(); - - b.ToTable("Images", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("OwnerId") - .HasColumnType("uuid"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.ToTable("Organizations", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => - { - b.Property("TournamentId") - .HasColumnType("bigint"); - - b.Property("Id") - .HasColumnType("integer"); - - b.Property("AlphabeticalId") - .HasColumnType("character(1)"); - - b.Property("DisplayName") - .HasMaxLength(25) - .HasColumnType("character varying(25)"); - - b.HasKey("TournamentId", "Id"); - - b.ToTable("Groups", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b => - { - b.Property("TournamentId") - .HasColumnType("bigint"); - - b.Property("GroupId") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("integer"); - - b.Property("Order") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.HasKey("TournamentId", "GroupId", "TeamId"); - - b.HasIndex("TournamentId", "TeamId"); - - b.ToTable("GroupParticipants", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b => - { - b.Property("TournamentId") - .HasColumnType("bigint"); - - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Court") - .HasColumnType("smallint"); - - b.Property("FinalsRound") - .HasColumnType("integer"); - - b.Property("GroupId") - .HasColumnType("integer"); - - b.Property("Index") - .HasColumnType("integer"); - - b.Property("IsCurrentlyPlaying") - .HasColumnType("boolean"); - - b.Property("Kickoff") - .HasColumnType("timestamp with time zone"); - - b.Property("OutcomeType") - .HasColumnType("integer"); - - b.Property("PlayoffPosition") - .HasColumnType("integer"); - - b.Property("ScoreA") - .HasColumnType("integer"); - - b.Property("ScoreB") - .HasColumnType("integer"); - - b.Property("TeamSelectorA") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TeamSelectorB") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("TournamentId", "Id"); - - b.HasIndex("TournamentId", "GroupId"); - - b.ToTable("Matches", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b => - { - b.Property("TournamentId") - .HasColumnType("bigint"); - - b.Property("Id") - .HasColumnType("integer"); - - b.Property("EntryFeePaidAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("OutOfCompetition") - .HasColumnType("boolean"); - - b.HasKey("TournamentId", "Id"); - - b.ToTable("Teams", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("FolderId") - .HasColumnType("bigint"); - - b.Property("IsMigrated") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("OrganizationId") - .HasColumnType("bigint"); - - b.Property("OrganizerLogoId") - .HasColumnType("bigint"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.Property("PublicPageViews") - .HasColumnType("integer"); - - b.Property("SponsorBannerId") - .HasColumnType("bigint"); - - b.Property("SponsorLogoId") - .HasColumnType("bigint"); - - b.Property("VenueId") - .HasColumnType("bigint"); - - b.Property("Visibility") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("OrganizationId"); - - b.HasIndex("OrganizerLogoId"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.HasIndex("SponsorBannerId"); - - b.HasIndex("SponsorLogoId"); - - b.HasIndex("VenueId"); - - b.ToTable("Tournaments", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.User.Role", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("character varying(16)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("Roles", "turnierplan"); - - b.HasData( - new - { - Id = new Guid("9da7acec-ed66-4698-a2d6-927c9ee3f83a"), - Name = "Administrator" - }); - }); - - modelBuilder.Entity("Turnierplan.Core.User.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("EMail") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastLogin") - .HasColumnType("timestamp with time zone"); - - b.Property("LastPasswordChange") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("NormalizedEMail") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SecurityStamp") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEMail") - .IsUnique(); - - b.ToTable("Users", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.PrimitiveCollection>("AddressDetails") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.PrimitiveCollection>("ExternalLinks") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("OrganizationId") - .HasColumnType("bigint"); - - b.Property("PublicId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationId"); - - b.HasIndex("PublicId") - .IsUnique(); - - b.ToTable("Venues", "turnierplan"); - }); - - modelBuilder.Entity("UserRoles", b => - { - b.Property("RoleId") - .HasColumnType("uuid"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("RoleId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("UserRoles", "turnierplan"); - }); - - modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => - { - b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") - .WithMany("ApiKeys") - .HasForeignKey("OrganizationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Organization"); - }); - - modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b => - { - b.HasOne("Turnierplan.Core.ApiKey.ApiKey", "ApiKey") - .WithMany("Requests") - .HasForeignKey("ApiKeyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApiKey"); - }); - - modelBuilder.Entity("Turnierplan.Core.Document.Document", b => - { - b.HasOne("Turnierplan.Core.Tournament.Tournament", "Tournament") - .WithMany("Documents") - .HasForeignKey("TournamentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tournament"); - }); - - modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => - { - b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") - .WithMany("Folders") - .HasForeignKey("OrganizationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Organization"); - }); - - modelBuilder.Entity("Turnierplan.Core.Image.Image", b => - { - b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") - .WithMany("Images") - .HasForeignKey("OrganizationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Organization"); - }); - - modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => - { - b.HasOne("Turnierplan.Core.User.User", null) - .WithMany("Organizations") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => - { - b.HasOne("Turnierplan.Core.Tournament.Tournament", null) - .WithMany("Groups") - .HasForeignKey("TournamentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b => - { - b.HasOne("Turnierplan.Core.Tournament.Group", "Group") - .WithMany("Participants") - .HasForeignKey("TournamentId", "GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Turnierplan.Core.Tournament.Team", "Team") - .WithMany() - .HasForeignKey("TournamentId", "TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Group"); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b => - { - b.HasOne("Turnierplan.Core.Tournament.Tournament", null) - .WithMany("Matches") - .HasForeignKey("TournamentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Turnierplan.Core.Tournament.Group", "Group") - .WithMany() - .HasForeignKey("TournamentId", "GroupId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b => - { - b.HasOne("Turnierplan.Core.Tournament.Tournament", null) - .WithMany("Teams") - .HasForeignKey("TournamentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => - { - b.HasOne("Turnierplan.Core.Folder.Folder", "Folder") - .WithMany("Tournaments") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") - .WithMany("Tournaments") - .HasForeignKey("OrganizationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Turnierplan.Core.Image.Image", "OrganizerLogo") - .WithMany() - .HasForeignKey("OrganizerLogoId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Turnierplan.Core.Image.Image", "SponsorBanner") - .WithMany() - .HasForeignKey("SponsorBannerId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Turnierplan.Core.Image.Image", "SponsorLogo") - .WithMany() - .HasForeignKey("SponsorLogoId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Turnierplan.Core.Venue.Venue", "Venue") - .WithMany("Tournaments") - .HasForeignKey("VenueId") - .OnDelete(DeleteBehavior.SetNull); - - b.OwnsOne("Turnierplan.Core.Tournament.ComputationConfiguration", "ComputationConfiguration", b1 => - { - b1.Property("TournamentId") - .HasColumnType("bigint"); - - b1.PrimitiveCollection("ComparisonModes") - .IsRequired() - .HasColumnType("integer[]") - .HasAnnotation("Relational:JsonPropertyName", "cmp"); - - b1.Property("HigherScoreLoses") - .HasColumnType("boolean") - .HasAnnotation("Relational:JsonPropertyName", "r"); - - b1.Property("MatchDrawnPoints") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "d"); - - b1.Property("MatchLostPoints") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "l"); - - b1.Property("MatchWonPoints") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "w"); - - b1.HasKey("TournamentId"); - - b1.ToTable("Tournaments", "turnierplan"); - - b1.ToJson("ComputationConfiguration"); - - b1.WithOwner() - .HasForeignKey("TournamentId"); - }); - - b.OwnsOne("Turnierplan.Core.Tournament.MatchPlanConfiguration", "MatchPlanConfiguration", b1 => - { - b1.Property("TournamentId") - .HasColumnType("bigint"); - - b1.HasKey("TournamentId"); - - b1.ToTable("Tournaments", "turnierplan"); - - b1.ToJson("MatchPlanConfiguration"); - - b1.WithOwner() - .HasForeignKey("TournamentId"); - - b1.OwnsOne("Turnierplan.Core.Tournament.FinalsRoundConfig", "FinalsRoundConfig", b2 => - { - b2.Property("MatchPlanConfigurationTournamentId") - .HasColumnType("bigint"); - - b2.Property("EnableThirdPlacePlayoff") - .HasColumnType("boolean") - .HasAnnotation("Relational:JsonPropertyName", "3rd"); - - b2.Property("FirstFinalsRoundOrder") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "fo"); - - b2.PrimitiveCollection>("TeamSelectors") - .HasColumnType("text[]") - .HasAnnotation("Relational:JsonPropertyName", "ts"); - - b2.HasKey("MatchPlanConfigurationTournamentId"); - - b2.ToTable("Tournaments", "turnierplan"); - - b2.HasAnnotation("Relational:JsonPropertyName", "fr"); - - b2.WithOwner() - .HasForeignKey("MatchPlanConfigurationTournamentId"); - - b2.OwnsMany("Turnierplan.Core.Tournament.AdditionalPlayoffConfig", "AdditionalPlayoffs", b3 => - { - b3.Property("FinalsRoundConfigMatchPlanConfigurationTournamentId") - .HasColumnType("bigint"); - - b3.Property("__synthesizedOrdinal") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - b3.Property("PlayoffPosition") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "p"); - - b3.Property("TeamSelectorA") - .IsRequired() - .HasColumnType("text") - .HasAnnotation("Relational:JsonPropertyName", "a"); - - b3.Property("TeamSelectorB") - .IsRequired() - .HasColumnType("text") - .HasAnnotation("Relational:JsonPropertyName", "b"); - - b3.HasKey("FinalsRoundConfigMatchPlanConfigurationTournamentId", "__synthesizedOrdinal"); - - b3.ToTable("Tournaments", "turnierplan"); - - b3.HasAnnotation("Relational:JsonPropertyName", "ap"); - - b3.WithOwner() - .HasForeignKey("FinalsRoundConfigMatchPlanConfigurationTournamentId"); - }); - - b2.Navigation("AdditionalPlayoffs"); - }); - - b1.OwnsOne("Turnierplan.Core.Tournament.GroupRoundConfig", "GroupRoundConfig", b2 => - { - b2.Property("MatchPlanConfigurationTournamentId") - .HasColumnType("bigint"); - - b2.Property("GroupMatchOrder") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "o"); - - b2.Property("GroupPhaseRounds") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "r"); - - b2.HasKey("MatchPlanConfigurationTournamentId"); - - b2.ToTable("Tournaments", "turnierplan"); - - b2.HasAnnotation("Relational:JsonPropertyName", "gr"); - - b2.WithOwner() - .HasForeignKey("MatchPlanConfigurationTournamentId"); - }); - - b1.OwnsOne("Turnierplan.Core.Tournament.ScheduleConfig", "ScheduleConfig", b2 => - { - b2.Property("MatchPlanConfigurationTournamentId") - .HasColumnType("bigint"); - - b2.Property("FinalsPhaseNumberOfCourts") - .HasColumnType("smallint") - .HasAnnotation("Relational:JsonPropertyName", "fc"); - - b2.Property("FinalsPhasePauseTime") - .HasColumnType("interval") - .HasAnnotation("Relational:JsonPropertyName", "fp"); - - b2.Property("FinalsPhasePlayTime") - .HasColumnType("interval") - .HasAnnotation("Relational:JsonPropertyName", "fd"); - - b2.Property("FirstMatchKickoff") - .HasColumnType("timestamp with time zone") - .HasAnnotation("Relational:JsonPropertyName", "f"); - - b2.Property("GroupPhaseNumberOfCourts") - .HasColumnType("smallint") - .HasAnnotation("Relational:JsonPropertyName", "gc"); - - b2.Property("GroupPhasePauseTime") - .HasColumnType("interval") - .HasAnnotation("Relational:JsonPropertyName", "gp"); - - b2.Property("GroupPhasePlayTime") - .HasColumnType("interval") - .HasAnnotation("Relational:JsonPropertyName", "gd"); - - b2.Property("PauseBetweenGroupAndFinalsPhase") - .HasColumnType("interval") - .HasAnnotation("Relational:JsonPropertyName", "p"); - - b2.HasKey("MatchPlanConfigurationTournamentId"); - - b2.ToTable("Tournaments", "turnierplan"); - - b2.HasAnnotation("Relational:JsonPropertyName", "sc"); - - b2.WithOwner() - .HasForeignKey("MatchPlanConfigurationTournamentId"); - }); - - b1.Navigation("FinalsRoundConfig"); - - b1.Navigation("GroupRoundConfig"); - - b1.Navigation("ScheduleConfig"); - }); - - b.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration", "PresentationConfiguration", b1 => - { - b1.Property("TournamentId") - .HasColumnType("bigint"); - - b1.Property("ShowOrganizerLogo") - .HasColumnType("boolean") - .HasAnnotation("Relational:JsonPropertyName", "ol"); - - b1.Property("ShowResults") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "o"); - - b1.Property("ShowSponsorLogo") - .HasColumnType("boolean") - .HasAnnotation("Relational:JsonPropertyName", "sl"); - - b1.HasKey("TournamentId"); - - b1.ToTable("Tournaments", "turnierplan"); - - b1.ToJson("PresentationConfiguration"); - - b1.WithOwner() - .HasForeignKey("TournamentId"); - - b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header1", b2 => - { - b2.Property("PresentationConfigurationTournamentId") - .HasColumnType("bigint"); - - b2.Property("Content") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "c"); - - b2.Property("CustomContent") - .HasColumnType("text") - .HasAnnotation("Relational:JsonPropertyName", "cc"); - - b2.HasKey("PresentationConfigurationTournamentId"); - - b2.ToTable("Tournaments", "turnierplan"); - - b2.HasAnnotation("Relational:JsonPropertyName", "h1"); - - b2.WithOwner() - .HasForeignKey("PresentationConfigurationTournamentId"); - }); - - b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header2", b2 => - { - b2.Property("PresentationConfigurationTournamentId") - .HasColumnType("bigint"); - - b2.Property("Content") - .HasColumnType("integer") - .HasAnnotation("Relational:JsonPropertyName", "c"); - - b2.Property("CustomContent") - .HasColumnType("text") - .HasAnnotation("Relational:JsonPropertyName", "cc"); - - b2.HasKey("PresentationConfigurationTournamentId"); - - b2.ToTable("Tournaments", "turnierplan"); - - b2.HasAnnotation("Relational:JsonPropertyName", "h2"); - - b2.WithOwner() - .HasForeignKey("PresentationConfigurationTournamentId"); - }); - - b1.Navigation("Header1") - .IsRequired(); - - b1.Navigation("Header2") - .IsRequired(); - }); - - b.Navigation("ComputationConfiguration") - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("MatchPlanConfiguration"); - - b.Navigation("Organization"); - - b.Navigation("OrganizerLogo"); - - b.Navigation("PresentationConfiguration") - .IsRequired(); - - b.Navigation("SponsorBanner"); - - b.Navigation("SponsorLogo"); - - b.Navigation("Venue"); - }); - - modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => - { - b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") - .WithMany("Venues") - .HasForeignKey("OrganizationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Organization"); - }); - - modelBuilder.Entity("UserRoles", b => - { - b.HasOne("Turnierplan.Core.User.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Turnierplan.Core.User.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => - { - b.Navigation("Requests"); - }); - - modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => - { - b.Navigation("Tournaments"); - }); - - modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => - { - b.Navigation("ApiKeys"); - - b.Navigation("Folders"); - - b.Navigation("Images"); - - b.Navigation("Tournaments"); - - b.Navigation("Venues"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => - { - b.Navigation("Documents"); - - b.Navigation("Groups"); - - b.Navigation("Matches"); - - b.Navigation("Teams"); - }); - - modelBuilder.Entity("Turnierplan.Core.User.User", b => - { - b.Navigation("Organizations"); - }); - - modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => - { - b.Navigation("Tournaments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs deleted file mode 100644 index f88ce5d0..00000000 --- a/src/Turnierplan.Dal/Migrations/20250613192644_Add_HigherScoreLoses.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Turnierplan.Dal.Migrations -{ - /// - public partial class Add_HigherScoreLoses : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} From 79949dda30a707234bc75ae0ca363f345d18d924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 15 Jun 2025 17:03:41 +0200 Subject: [PATCH 04/11] reset snapshot --- .../Migrations/TurnierplanContextModelSnapshot.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs index fde90760..c975cf02 100644 --- a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs +++ b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs @@ -958,10 +958,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer[]") .HasAnnotation("Relational:JsonPropertyName", "cmp"); - b1.Property("HigherScoreLoses") - .HasColumnType("boolean") - .HasAnnotation("Relational:JsonPropertyName", "r"); - b1.Property("MatchDrawnPoints") .HasColumnType("integer") .HasAnnotation("Relational:JsonPropertyName", "d"); From c70b5adefede1077dff851e1ba25fc7c137e2557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 15 Jun 2025 17:04:47 +0200 Subject: [PATCH 05/11] Add DB migration --- ...615150354_Add_HigherScoreLoses.Designer.cs | 1315 +++++++++++++++++ .../20250615150354_Add_HigherScoreLoses.cs | 22 + .../TurnierplanContextModelSnapshot.cs | 4 + 3 files changed, 1341 insertions(+) create mode 100644 src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs create mode 100644 src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.cs diff --git a/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs new file mode 100644 index 00000000..48e6d0b6 --- /dev/null +++ b/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs @@ -0,0 +1,1315 @@ +// +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Turnierplan.Dal; + +#nullable disable + +namespace Turnierplan.Dal.Migrations +{ + [DbContext(typeof(TurnierplanContext))] + [Migration("20250615150354_Add_HigherScoreLoses")] + partial class Add_HigherScoreLoses + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.6") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(25) + .HasColumnType("character varying(25)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("SecretHash") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("ApiKeys", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKeyId") + .HasColumnType("bigint"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("character varying(150)"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ApiKeyId"); + + b.HasIndex("Timestamp"); + + b.ToTable("ApiKeyRequests", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Document.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Configuration") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerationCount") + .HasColumnType("integer"); + + b.Property("LastGeneration") + .HasColumnType("timestamp with time zone"); + + b.Property("LastModifiedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.HasIndex("TournamentId"); + + b.ToTable("Documents", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("Folders", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Image.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("character varying(5)"); + + b.Property("Height") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("ResourceIdentifier") + .HasColumnType("uuid"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Width") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.HasIndex("ResourceIdentifier") + .IsUnique(); + + b.ToTable("Images", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("Organizations", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKeyId") + .HasColumnType("bigint"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("Principal") + .IsRequired() + .HasColumnType("text"); + + b.Property("Role") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ApiKeyId"); + + b.ToTable("IAM_ApiKey", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("FolderId") + .HasColumnType("bigint"); + + b.Property("Principal") + .IsRequired() + .HasColumnType("text"); + + b.Property("Role") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("FolderId"); + + b.ToTable("IAM_Folder", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("ImageId") + .HasColumnType("bigint"); + + b.Property("Principal") + .IsRequired() + .HasColumnType("text"); + + b.Property("Role") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.ToTable("IAM_Image", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("Principal") + .IsRequired() + .HasColumnType("text"); + + b.Property("Role") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("IAM_Organization", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("Principal") + .IsRequired() + .HasColumnType("text"); + + b.Property("Role") + .HasColumnType("integer"); + + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TournamentId"); + + b.ToTable("IAM_Tournament", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("Principal") + .IsRequired() + .HasColumnType("text"); + + b.Property("Role") + .HasColumnType("integer"); + + b.Property("VenueId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("VenueId"); + + b.ToTable("IAM_Venue", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Id") + .HasColumnType("integer"); + + b.Property("AlphabeticalId") + .HasColumnType("character(1)"); + + b.Property("DisplayName") + .HasMaxLength(25) + .HasColumnType("character varying(25)"); + + b.HasKey("TournamentId", "Id"); + + b.ToTable("Groups", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("TeamId") + .HasColumnType("integer"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.HasKey("TournamentId", "GroupId", "TeamId"); + + b.HasIndex("TournamentId", "TeamId"); + + b.ToTable("GroupParticipants", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Court") + .HasColumnType("smallint"); + + b.Property("FinalsRound") + .HasColumnType("integer"); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsCurrentlyPlaying") + .HasColumnType("boolean"); + + b.Property("Kickoff") + .HasColumnType("timestamp with time zone"); + + b.Property("OutcomeType") + .HasColumnType("integer"); + + b.Property("PlayoffPosition") + .HasColumnType("integer"); + + b.Property("ScoreA") + .HasColumnType("integer"); + + b.Property("ScoreB") + .HasColumnType("integer"); + + b.Property("TeamSelectorA") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TeamSelectorB") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.HasKey("TournamentId", "Id"); + + b.HasIndex("TournamentId", "GroupId"); + + b.ToTable("Matches", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b => + { + b.Property("TournamentId") + .HasColumnType("bigint"); + + b.Property("Id") + .HasColumnType("integer"); + + b.Property("EntryFeePaidAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)"); + + b.Property("OutOfCompetition") + .HasColumnType("boolean"); + + b.HasKey("TournamentId", "Id"); + + b.ToTable("Teams", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FolderId") + .HasColumnType("bigint"); + + b.Property("IsMigrated") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("OrganizerLogoId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.Property("PublicPageViews") + .HasColumnType("integer"); + + b.Property("SponsorBannerId") + .HasColumnType("bigint"); + + b.Property("SponsorLogoId") + .HasColumnType("bigint"); + + b.Property("VenueId") + .HasColumnType("bigint"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("FolderId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("OrganizerLogoId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.HasIndex("SponsorBannerId"); + + b.HasIndex("SponsorLogoId"); + + b.HasIndex("VenueId"); + + b.ToTable("Tournaments", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.User.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EMail") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsAdministrator") + .HasColumnType("boolean"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastPasswordChange") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("NormalizedEMail") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEMail") + .IsUnique(); + + b.ToTable("Users", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.PrimitiveCollection>("AddressDetails") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.PrimitiveCollection>("ExternalLinks") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)"); + + b.Property("OrganizationId") + .HasColumnType("bigint"); + + b.Property("PublicId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PublicId") + .IsUnique(); + + b.ToTable("Venues", "turnierplan"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("ApiKeys") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b => + { + b.HasOne("Turnierplan.Core.ApiKey.ApiKey", "ApiKey") + .WithMany("Requests") + .HasForeignKey("ApiKeyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApiKey"); + }); + + modelBuilder.Entity("Turnierplan.Core.Document.Document", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", "Tournament") + .WithMany("Documents") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tournament"); + }); + + modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Folders") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.Image.Image", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Images") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.HasOne("Turnierplan.Core.ApiKey.ApiKey", "Scope") + .WithMany("RoleAssignments") + .HasForeignKey("ApiKeyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Scope"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.HasOne("Turnierplan.Core.Folder.Folder", "Scope") + .WithMany("RoleAssignments") + .HasForeignKey("FolderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Scope"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.HasOne("Turnierplan.Core.Image.Image", "Scope") + .WithMany("RoleAssignments") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Scope"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Scope") + .WithMany("RoleAssignments") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Scope"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", "Scope") + .WithMany("RoleAssignments") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Scope"); + }); + + modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => + { + b.HasOne("Turnierplan.Core.Venue.Venue", "Scope") + .WithMany("RoleAssignments") + .HasForeignKey("VenueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Scope"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", null) + .WithMany("Groups") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b => + { + b.HasOne("Turnierplan.Core.Tournament.Group", "Group") + .WithMany("Participants") + .HasForeignKey("TournamentId", "GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Turnierplan.Core.Tournament.Team", "Team") + .WithMany() + .HasForeignKey("TournamentId", "TeamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", null) + .WithMany("Matches") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Turnierplan.Core.Tournament.Group", "Group") + .WithMany() + .HasForeignKey("TournamentId", "GroupId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b => + { + b.HasOne("Turnierplan.Core.Tournament.Tournament", null) + .WithMany("Teams") + .HasForeignKey("TournamentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => + { + b.HasOne("Turnierplan.Core.Folder.Folder", "Folder") + .WithMany("Tournaments") + .HasForeignKey("FolderId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Tournaments") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Turnierplan.Core.Image.Image", "OrganizerLogo") + .WithMany() + .HasForeignKey("OrganizerLogoId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Image.Image", "SponsorBanner") + .WithMany() + .HasForeignKey("SponsorBannerId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Image.Image", "SponsorLogo") + .WithMany() + .HasForeignKey("SponsorLogoId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Turnierplan.Core.Venue.Venue", "Venue") + .WithMany("Tournaments") + .HasForeignKey("VenueId") + .OnDelete(DeleteBehavior.SetNull); + + b.OwnsOne("Turnierplan.Core.Tournament.ComputationConfiguration", "ComputationConfiguration", b1 => + { + b1.Property("TournamentId") + .HasColumnType("bigint"); + + b1.PrimitiveCollection("ComparisonModes") + .IsRequired() + .HasColumnType("integer[]") + .HasAnnotation("Relational:JsonPropertyName", "cmp"); + + b1.Property("HigherScoreLoses") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "r"); + + b1.Property("MatchDrawnPoints") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "d"); + + b1.Property("MatchLostPoints") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "l"); + + b1.Property("MatchWonPoints") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "w"); + + b1.HasKey("TournamentId"); + + b1.ToTable("Tournaments", "turnierplan"); + + b1.ToJson("ComputationConfiguration"); + + b1.WithOwner() + .HasForeignKey("TournamentId"); + }); + + b.OwnsOne("Turnierplan.Core.Tournament.MatchPlanConfiguration", "MatchPlanConfiguration", b1 => + { + b1.Property("TournamentId") + .HasColumnType("bigint"); + + b1.HasKey("TournamentId"); + + b1.ToTable("Tournaments", "turnierplan"); + + b1.ToJson("MatchPlanConfiguration"); + + b1.WithOwner() + .HasForeignKey("TournamentId"); + + b1.OwnsOne("Turnierplan.Core.Tournament.FinalsRoundConfig", "FinalsRoundConfig", b2 => + { + b2.Property("MatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("EnableThirdPlacePlayoff") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "3rd"); + + b2.Property("FirstFinalsRoundOrder") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "fo"); + + b2.PrimitiveCollection>("TeamSelectors") + .HasColumnType("text[]") + .HasAnnotation("Relational:JsonPropertyName", "ts"); + + b2.HasKey("MatchPlanConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "fr"); + + b2.WithOwner() + .HasForeignKey("MatchPlanConfigurationTournamentId"); + + b2.OwnsMany("Turnierplan.Core.Tournament.AdditionalPlayoffConfig", "AdditionalPlayoffs", b3 => + { + b3.Property("FinalsRoundConfigMatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b3.Property("__synthesizedOrdinal") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + b3.Property("PlayoffPosition") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "p"); + + b3.Property("TeamSelectorA") + .IsRequired() + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "a"); + + b3.Property("TeamSelectorB") + .IsRequired() + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "b"); + + b3.HasKey("FinalsRoundConfigMatchPlanConfigurationTournamentId", "__synthesizedOrdinal"); + + b3.ToTable("Tournaments", "turnierplan"); + + b3.HasAnnotation("Relational:JsonPropertyName", "ap"); + + b3.WithOwner() + .HasForeignKey("FinalsRoundConfigMatchPlanConfigurationTournamentId"); + }); + + b2.Navigation("AdditionalPlayoffs"); + }); + + b1.OwnsOne("Turnierplan.Core.Tournament.GroupRoundConfig", "GroupRoundConfig", b2 => + { + b2.Property("MatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("GroupMatchOrder") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "o"); + + b2.Property("GroupPhaseRounds") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "r"); + + b2.HasKey("MatchPlanConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "gr"); + + b2.WithOwner() + .HasForeignKey("MatchPlanConfigurationTournamentId"); + }); + + b1.OwnsOne("Turnierplan.Core.Tournament.ScheduleConfig", "ScheduleConfig", b2 => + { + b2.Property("MatchPlanConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("FinalsPhaseNumberOfCourts") + .HasColumnType("smallint") + .HasAnnotation("Relational:JsonPropertyName", "fc"); + + b2.Property("FinalsPhasePauseTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "fp"); + + b2.Property("FinalsPhasePlayTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "fd"); + + b2.Property("FirstMatchKickoff") + .HasColumnType("timestamp with time zone") + .HasAnnotation("Relational:JsonPropertyName", "f"); + + b2.Property("GroupPhaseNumberOfCourts") + .HasColumnType("smallint") + .HasAnnotation("Relational:JsonPropertyName", "gc"); + + b2.Property("GroupPhasePauseTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "gp"); + + b2.Property("GroupPhasePlayTime") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "gd"); + + b2.Property("PauseBetweenGroupAndFinalsPhase") + .HasColumnType("interval") + .HasAnnotation("Relational:JsonPropertyName", "p"); + + b2.HasKey("MatchPlanConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "sc"); + + b2.WithOwner() + .HasForeignKey("MatchPlanConfigurationTournamentId"); + }); + + b1.Navigation("FinalsRoundConfig"); + + b1.Navigation("GroupRoundConfig"); + + b1.Navigation("ScheduleConfig"); + }); + + b.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration", "PresentationConfiguration", b1 => + { + b1.Property("TournamentId") + .HasColumnType("bigint"); + + b1.Property("ShowOrganizerLogo") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "ol"); + + b1.Property("ShowResults") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "o"); + + b1.Property("ShowSponsorLogo") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "sl"); + + b1.HasKey("TournamentId"); + + b1.ToTable("Tournaments", "turnierplan"); + + b1.ToJson("PresentationConfiguration"); + + b1.WithOwner() + .HasForeignKey("TournamentId"); + + b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header1", b2 => + { + b2.Property("PresentationConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("Content") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "c"); + + b2.Property("CustomContent") + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "cc"); + + b2.HasKey("PresentationConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "h1"); + + b2.WithOwner() + .HasForeignKey("PresentationConfigurationTournamentId"); + }); + + b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header2", b2 => + { + b2.Property("PresentationConfigurationTournamentId") + .HasColumnType("bigint"); + + b2.Property("Content") + .HasColumnType("integer") + .HasAnnotation("Relational:JsonPropertyName", "c"); + + b2.Property("CustomContent") + .HasColumnType("text") + .HasAnnotation("Relational:JsonPropertyName", "cc"); + + b2.HasKey("PresentationConfigurationTournamentId"); + + b2.ToTable("Tournaments", "turnierplan"); + + b2.HasAnnotation("Relational:JsonPropertyName", "h2"); + + b2.WithOwner() + .HasForeignKey("PresentationConfigurationTournamentId"); + }); + + b1.Navigation("Header1") + .IsRequired(); + + b1.Navigation("Header2") + .IsRequired(); + }); + + b.Navigation("ComputationConfiguration") + .IsRequired(); + + b.Navigation("Folder"); + + b.Navigation("MatchPlanConfiguration"); + + b.Navigation("Organization"); + + b.Navigation("OrganizerLogo"); + + b.Navigation("PresentationConfiguration") + .IsRequired(); + + b.Navigation("SponsorBanner"); + + b.Navigation("SponsorLogo"); + + b.Navigation("Venue"); + }); + + modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => + { + b.HasOne("Turnierplan.Core.Organization.Organization", "Organization") + .WithMany("Venues") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b => + { + b.Navigation("Requests"); + + b.Navigation("RoleAssignments"); + }); + + modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b => + { + b.Navigation("RoleAssignments"); + + b.Navigation("Tournaments"); + }); + + modelBuilder.Entity("Turnierplan.Core.Image.Image", b => + { + b.Navigation("RoleAssignments"); + }); + + modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b => + { + b.Navigation("ApiKeys"); + + b.Navigation("Folders"); + + b.Navigation("Images"); + + b.Navigation("RoleAssignments"); + + b.Navigation("Tournaments"); + + b.Navigation("Venues"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b => + { + b.Navigation("Participants"); + }); + + modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b => + { + b.Navigation("Documents"); + + b.Navigation("Groups"); + + b.Navigation("Matches"); + + b.Navigation("RoleAssignments"); + + b.Navigation("Teams"); + }); + + modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b => + { + b.Navigation("RoleAssignments"); + + b.Navigation("Tournaments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.cs new file mode 100644 index 00000000..f88ce5d0 --- /dev/null +++ b/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Turnierplan.Dal.Migrations +{ + /// + public partial class Add_HigherScoreLoses : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs index c975cf02..fde90760 100644 --- a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs +++ b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs @@ -958,6 +958,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer[]") .HasAnnotation("Relational:JsonPropertyName", "cmp"); + b1.Property("HigherScoreLoses") + .HasColumnType("boolean") + .HasAnnotation("Relational:JsonPropertyName", "r"); + b1.Property("MatchDrawnPoints") .HasColumnType("integer") .HasAnnotation("Relational:JsonPropertyName", "d"); From 428e5ecf8fd273b9022ff5192438e05e643301d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 15 Jun 2025 20:01:32 +0200 Subject: [PATCH 06/11] Re-create migration again --- ...15180114_Add_HigherScoreLoses.Designer.cs} | 38 +++++++------------ ...=> 20250615180114_Add_HigherScoreLoses.cs} | 0 2 files changed, 13 insertions(+), 25 deletions(-) rename src/Turnierplan.Dal/Migrations/{20250615150354_Add_HigherScoreLoses.Designer.cs => 20250615180114_Add_HigherScoreLoses.Designer.cs} (97%) rename src/Turnierplan.Dal/Migrations/{20250615150354_Add_HigherScoreLoses.cs => 20250615180114_Add_HigherScoreLoses.cs} (100%) diff --git a/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.Designer.cs similarity index 97% rename from src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs rename to src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.Designer.cs index 48e6d0b6..0a9d3358 100644 --- a/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.Designer.cs +++ b/src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.Designer.cs @@ -13,7 +13,7 @@ namespace Turnierplan.Dal.Migrations { [DbContext(typeof(TurnierplanContext))] - [Migration("20250615150354_Add_HigherScoreLoses")] + [Migration("20250615180114_Add_HigherScoreLoses")] partial class Add_HigherScoreLoses { /// @@ -266,11 +266,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnType("uuid"); b.Property("ApiKeyId") .HasColumnType("bigint"); @@ -299,11 +297,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); @@ -332,11 +328,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); @@ -365,11 +359,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); @@ -398,11 +390,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); @@ -431,11 +421,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); diff --git a/src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.cs similarity index 100% rename from src/Turnierplan.Dal/Migrations/20250615150354_Add_HigherScoreLoses.cs rename to src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.cs From f97dbd0b0ae37280f67c3abe1cce389c7e46265e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Mon, 23 Jun 2025 16:29:13 +0200 Subject: [PATCH 07/11] re-add migration once again :) --- ...0250623142853_Add_HigherScoreLoses.Designer.cs} | 14 +++++++++++++- ...s.cs => 20250623142853_Add_HigherScoreLoses.cs} | 0 2 files changed, 13 insertions(+), 1 deletion(-) rename src/Turnierplan.Dal/Migrations/{20250615180114_Add_HigherScoreLoses.Designer.cs => 20250623142853_Add_HigherScoreLoses.Designer.cs} (99%) rename src/Turnierplan.Dal/Migrations/{20250615180114_Add_HigherScoreLoses.cs => 20250623142853_Add_HigherScoreLoses.cs} (100%) diff --git a/src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.Designer.cs similarity index 99% rename from src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.Designer.cs rename to src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.Designer.cs index 0a9d3358..b241d00e 100644 --- a/src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.Designer.cs +++ b/src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.Designer.cs @@ -13,7 +13,7 @@ namespace Turnierplan.Dal.Migrations { [DbContext(typeof(TurnierplanContext))] - [Migration("20250615180114_Add_HigherScoreLoses")] + [Migration("20250623142853_Add_HigherScoreLoses")] partial class Add_HigherScoreLoses { /// @@ -56,6 +56,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("OrganizationId") .HasColumnType("bigint"); + b.Property("PrincipalId") + .HasColumnType("uuid"); + b.Property("PublicId") .HasColumnType("bigint"); @@ -67,6 +70,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("OrganizationId"); + b.HasIndex("PrincipalId") + .IsUnique(); + b.HasIndex("PublicId") .IsUnique(); @@ -676,6 +682,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("text"); + b.Property("PrincipalId") + .HasColumnType("uuid"); + b.Property("SecurityStamp") .HasColumnType("uuid"); @@ -684,6 +693,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("NormalizedEMail") .IsUnique(); + b.HasIndex("PrincipalId") + .IsUnique(); + b.ToTable("Users", "turnierplan"); }); diff --git a/src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.cs similarity index 100% rename from src/Turnierplan.Dal/Migrations/20250615180114_Add_HigherScoreLoses.cs rename to src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.cs From 970f70fb5e689e5f2e08ca2a151ec6cf0cfecd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sat, 28 Jun 2025 10:46:16 +0200 Subject: [PATCH 08/11] recreate migration --- ...28084603_Add_HigherScoreLoses.Designer.cs} | 32 +------------------ ...=> 20250628084603_Add_HigherScoreLoses.cs} | 0 2 files changed, 1 insertion(+), 31 deletions(-) rename src/Turnierplan.Dal/Migrations/{20250623142853_Add_HigherScoreLoses.Designer.cs => 20250628084603_Add_HigherScoreLoses.Designer.cs} (97%) rename src/Turnierplan.Dal/Migrations/{20250623142853_Add_HigherScoreLoses.cs => 20250628084603_Add_HigherScoreLoses.cs} (100%) diff --git a/src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.Designer.cs similarity index 97% rename from src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.Designer.cs rename to src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.Designer.cs index b241d00e..777cd199 100644 --- a/src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.Designer.cs +++ b/src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.Designer.cs @@ -13,7 +13,7 @@ namespace Turnierplan.Dal.Migrations { [DbContext(typeof(TurnierplanContext))] - [Migration("20250623142853_Add_HigherScoreLoses")] + [Migration("20250628084603_Add_HigherScoreLoses")] partial class Add_HigherScoreLoses { /// @@ -282,11 +282,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - b.Property("Principal") .IsRequired() .HasColumnType("text"); @@ -310,11 +305,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - b.Property("FolderId") .HasColumnType("bigint"); @@ -341,11 +331,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - b.Property("ImageId") .HasColumnType("bigint"); @@ -372,11 +357,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - b.Property("OrganizationId") .HasColumnType("bigint"); @@ -403,11 +383,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - b.Property("Principal") .IsRequired() .HasColumnType("text"); @@ -434,11 +409,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); - b.Property("Description") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - b.Property("Principal") .IsRequired() .HasColumnType("text"); diff --git a/src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.cs similarity index 100% rename from src/Turnierplan.Dal/Migrations/20250623142853_Add_HigherScoreLoses.cs rename to src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.cs From 5538b798e9df6679487dca2ef2ab3c1049fed591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 6 Jul 2025 19:05:03 +0200 Subject: [PATCH 09/11] Re-create migration for the last time --- ...igner.cs => 20250706170447_Add_HigherScoreLoses.Designer.cs} | 2 +- ...gherScoreLoses.cs => 20250706170447_Add_HigherScoreLoses.cs} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/Turnierplan.Dal/Migrations/{20250628084603_Add_HigherScoreLoses.Designer.cs => 20250706170447_Add_HigherScoreLoses.Designer.cs} (99%) rename src/Turnierplan.Dal/Migrations/{20250628084603_Add_HigherScoreLoses.cs => 20250706170447_Add_HigherScoreLoses.cs} (100%) diff --git a/src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.Designer.cs similarity index 99% rename from src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.Designer.cs rename to src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.Designer.cs index 777cd199..aff8a0ec 100644 --- a/src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.Designer.cs +++ b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.Designer.cs @@ -13,7 +13,7 @@ namespace Turnierplan.Dal.Migrations { [DbContext(typeof(TurnierplanContext))] - [Migration("20250628084603_Add_HigherScoreLoses")] + [Migration("20250706170447_Add_HigherScoreLoses")] partial class Add_HigherScoreLoses { /// diff --git a/src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.cs similarity index 100% rename from src/Turnierplan.Dal/Migrations/20250628084603_Add_HigherScoreLoses.cs rename to src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.cs From 824cb1f7b881801f7552a993efb375f3164615a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 6 Jul 2025 19:15:45 +0200 Subject: [PATCH 10/11] Add UI changes --- src/Turnierplan.App/Client/src/app/i18n/de.ts | 5 +++++ .../computation-configuration.component.html | 17 +++++++++++++++++ .../computation-configuration.component.ts | 3 +++ .../view-tournament.component.html | 5 +++++ 4 files changed, 30 insertions(+) diff --git a/src/Turnierplan.App/Client/src/app/i18n/de.ts b/src/Turnierplan.App/Client/src/app/i18n/de.ts index 590b53c0..05c8ca19 100644 --- a/src/Turnierplan.App/Client/src/app/i18n/de.ts +++ b/src/Turnierplan.App/Client/src/app/i18n/de.ts @@ -519,6 +519,11 @@ export const de = { MatchWonPoints: 'Punkte für Sieg:', MatchDrawnPoints: 'Punkte für Unentschieden:', MatchLostPoints: 'Punkte für Niederlage:', + HigherScoreLoses: { + Label: 'Ergebnis invertieren:', + Tooltip: 'Wenn aktiviert, ist diejenige Mannschaft, welche weniger Tore geschossen hat, der Gewinner vom Spiel.', + Activated: 'Die Ergebnisse werden invertiert. Das heißt, die Mannschaft mit weniger Toren gewinnt.' + }, ComparisonModes: { Label: 'Platzierungsregel in Gruppen:', Values: { diff --git a/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html b/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html index 744b03a1..a05ec2f9 100644 --- a/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html +++ b/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html @@ -63,6 +63,23 @@