diff --git a/src/DatabaseBenchmarks/DatabaseBenchmarks.csproj b/src/DatabaseBenchmarks/DatabaseBenchmarks.csproj index 64c6aec..3e7240b 100644 --- a/src/DatabaseBenchmarks/DatabaseBenchmarks.csproj +++ b/src/DatabaseBenchmarks/DatabaseBenchmarks.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/iRLeagueDatabaseCore/Migrations/20240223233643_AddPointFormula.Designer.cs b/src/iRLeagueDatabaseCore/Migrations/20240223233643_AddPointFormula.Designer.cs new file mode 100644 index 0000000..a5ffb1b --- /dev/null +++ b/src/iRLeagueDatabaseCore/Migrations/20240223233643_AddPointFormula.Designer.cs @@ -0,0 +1,3948 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using iRLeagueDatabaseCore.Models; + +#nullable disable + +namespace iRLeagueDatabaseCore.Migrations +{ + [DbContext(typeof(LeagueDbContext))] + [Migration("20240223233643_AddPointFormula")] + partial class AddPointFormula + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("Latin1_General_CI_AS") + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("IncidentReviewEntityMemberEntity", b => + { + b.Property("InvolvedMembersId") + .HasColumnType("bigint"); + + b.Property("InvolvedReviewsLeagueId") + .HasColumnType("bigint"); + + b.Property("InvolvedReviewsReviewId") + .HasColumnType("bigint"); + + b.HasKey("InvolvedMembersId", "InvolvedReviewsLeagueId", "InvolvedReviewsReviewId"); + + b.HasIndex("InvolvedReviewsLeagueId", "InvolvedReviewsReviewId"); + + b.ToTable("IncidentReviewsInvolvedMembers", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AcceptedReviewVoteEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ReviewVoteId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("MemberAtFaultId") + .HasColumnType("bigint"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("TeamAtFaultId") + .HasColumnType("bigint"); + + b.Property("VoteCategoryId") + .HasColumnType("bigint"); + + b.HasKey("LeagueId", "ReviewVoteId"); + + b.HasAlternateKey("ReviewVoteId"); + + b.HasIndex("MemberAtFaultId"); + + b.HasIndex("ReviewId"); + + b.HasIndex("VoteCategoryId"); + + b.HasIndex("LeagueId", "ReviewId"); + + b.HasIndex("LeagueId", "TeamAtFaultId"); + + b.HasIndex("LeagueId", "VoteCategoryId"); + + b.ToTable("AcceptedReviewVotes"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AddPenaltyEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("AddPenaltyId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Corner") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Lap") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Reason") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("ScoredResultRowId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("json"); + + b.HasKey("LeagueId", "AddPenaltyId"); + + b.HasAlternateKey("AddPenaltyId"); + + b.HasIndex("LeagueId", "ScoredResultRowId"); + + b.ToTable("AddPenaltys"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AutoPenaltyConfigEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("PenaltyConfigId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Conditions") + .IsRequired() + .HasColumnType("json"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("PointRuleId") + .HasColumnType("bigint"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("Positions") + .HasColumnType("int"); + + b.Property("Time") + .HasColumnType("time(6)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("LeagueId", "PenaltyConfigId"); + + b.HasAlternateKey("PenaltyConfigId"); + + b.HasIndex("LeagueId", "PointRuleId"); + + b.ToTable("AutoPenaltyConfigs", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ChampionshipEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IsArchived") + .HasColumnType("tinyint(1)"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(80) + .HasColumnType("varchar(80)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ChampionshipId"); + + b.HasAlternateKey("ChampionshipId"); + + b.ToTable("Championships", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ChampSeasonEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ChampSeasonId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("DefaultResultConfigId") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime(6)"); + + b.Property("ResultKind") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("SeasonId") + .HasColumnType("bigint"); + + b.Property("StandingConfigId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ChampSeasonId"); + + b.HasAlternateKey("ChampSeasonId"); + + b.HasIndex("LeagueId", "ChampionshipId"); + + b.HasIndex("LeagueId", "DefaultResultConfigId"); + + b.HasIndex("LeagueId", "SeasonId"); + + b.HasIndex("LeagueId", "StandingConfigId"); + + b.ToTable("ChampSeasons", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.CustomIncidentEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("IncidentId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("Text") + .HasColumnType("longtext"); + + b.HasKey("LeagueId", "IncidentId"); + + b.HasAlternateKey("IncidentId"); + + b.ToTable("CustomIncidents"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.DriverStatisticRowEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("StatisticSetId") + .HasColumnType("bigint"); + + b.Property("MemberId") + .HasColumnType("bigint"); + + b.Property("AvgFinalPosition") + .HasColumnType("double"); + + b.Property("AvgFinishPosition") + .HasColumnType("double"); + + b.Property("AvgIRating") + .HasColumnType("double"); + + b.Property("AvgIncidentsPerKm") + .HasColumnType("double"); + + b.Property("AvgIncidentsPerLap") + .HasColumnType("double"); + + b.Property("AvgIncidentsPerRace") + .HasColumnType("double"); + + b.Property("AvgPenaltyPointsPerKm") + .HasColumnType("double"); + + b.Property("AvgPenaltyPointsPerLap") + .HasColumnType("double"); + + b.Property("AvgPenaltyPointsPerRace") + .HasColumnType("double"); + + b.Property("AvgPointsPerRace") + .HasColumnType("double"); + + b.Property("AvgSRating") + .HasColumnType("double"); + + b.Property("AvgStartPosition") + .HasColumnType("double"); + + b.Property("BestFinalPosition") + .HasColumnType("int"); + + b.Property("BestFinishPosition") + .HasColumnType("double"); + + b.Property("BestStartPosition") + .HasColumnType("double"); + + b.Property("BonusPoints") + .HasColumnType("double"); + + b.Property("CleanestDriverAwards") + .HasColumnType("int"); + + b.Property("CompletedLaps") + .HasColumnType("double"); + + b.Property("CurrentSeasonPosition") + .HasColumnType("int"); + + b.Property("DrivenKm") + .HasColumnType("double"); + + b.Property("EndIRating") + .HasColumnType("int"); + + b.Property("EndSRating") + .HasColumnType("double"); + + b.Property("FastestLaps") + .HasColumnType("int"); + + b.Property("FirstRaceDate") + .HasColumnType("datetime"); + + b.Property("FirstRaceFinalPosition") + .HasColumnType("int"); + + b.Property("FirstRaceFinishPosition") + .HasColumnType("double"); + + b.Property("FirstRaceId") + .HasColumnType("bigint"); + + b.Property("FirstRaceStartPosition") + .HasColumnType("double"); + + b.Property("FirstResultRowId") + .HasColumnType("bigint"); + + b.Property("FirstSessionDate") + .HasColumnType("datetime"); + + b.Property("FirstSessionId") + .HasColumnType("bigint"); + + b.Property("HardChargerAwards") + .HasColumnType("int"); + + b.Property("Incidents") + .HasColumnType("double"); + + b.Property("IncidentsUnderInvestigation") + .HasColumnType("int"); + + b.Property("IncidentsWithPenalty") + .HasColumnType("int"); + + b.Property("LastRaceDate") + .HasColumnType("datetime"); + + b.Property("LastRaceFinalPosition") + .HasColumnType("int"); + + b.Property("LastRaceFinishPosition") + .HasColumnType("double"); + + b.Property("LastRaceId") + .HasColumnType("bigint"); + + b.Property("LastRaceStartPosition") + .HasColumnType("double"); + + b.Property("LastResultRowId") + .HasColumnType("bigint"); + + b.Property("LastSessionDate") + .HasColumnType("datetime"); + + b.Property("LastSessionId") + .HasColumnType("bigint"); + + b.Property("LeadingKm") + .HasColumnType("double"); + + b.Property("LeadingLaps") + .HasColumnType("double"); + + b.Property("PenaltyPoints") + .HasColumnType("double"); + + b.Property("Poles") + .HasColumnType("int"); + + b.Property("RacePoints") + .HasColumnType("double"); + + b.Property("Races") + .HasColumnType("int"); + + b.Property("RacesCompleted") + .HasColumnType("int"); + + b.Property("RacesInPoints") + .HasColumnType("int"); + + b.Property("StartIRating") + .HasColumnType("int"); + + b.Property("StartSRating") + .HasColumnType("double"); + + b.Property("Titles") + .HasColumnType("int"); + + b.Property("Top10") + .HasColumnType("int"); + + b.Property("Top15") + .HasColumnType("int"); + + b.Property("Top20") + .HasColumnType("int"); + + b.Property("Top25") + .HasColumnType("int"); + + b.Property("Top3") + .HasColumnType("int"); + + b.Property("Top5") + .HasColumnType("int"); + + b.Property("TotalPoints") + .HasColumnType("double"); + + b.Property("Wins") + .HasColumnType("int"); + + b.Property("WorstFinalPosition") + .HasColumnType("int"); + + b.Property("WorstFinishPosition") + .HasColumnType("double"); + + b.Property("WorstStartPosition") + .HasColumnType("double"); + + b.HasKey("LeagueId", "StatisticSetId", "MemberId"); + + b.HasIndex("MemberId"); + + b.HasIndex("StatisticSetId"); + + b.HasIndex("LeagueId", "FirstRaceId"); + + b.HasIndex("LeagueId", "FirstResultRowId"); + + b.HasIndex("LeagueId", "FirstSessionId"); + + b.HasIndex("LeagueId", "LastRaceId"); + + b.HasIndex("LeagueId", "LastResultRowId"); + + b.HasIndex("LeagueId", "LastSessionId"); + + b.ToTable("DriverStatisticRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("EventId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("Date") + .HasColumnType("datetime"); + + b.Property("Duration") + .HasColumnType("bigint"); + + b.Property("EventType") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("IrResultLink") + .HasColumnType("longtext"); + + b.Property("IrSessionId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ScheduleId") + .HasColumnType("bigint"); + + b.Property("TrackId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "EventId"); + + b.HasAlternateKey("EventId"); + + b.HasIndex("TrackId"); + + b.HasIndex("LeagueId", "ScheduleId"); + + b.ToTable("Events"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventResultConfigs", b => + { + b.Property("EventRefId") + .HasColumnType("bigint"); + + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ResultConfigRefId") + .HasColumnType("bigint"); + + b.HasKey("EventRefId", "LeagueId", "ResultConfigRefId"); + + b.HasIndex("LeagueId", "EventRefId"); + + b.HasIndex("LeagueId", "ResultConfigRefId"); + + b.ToTable("EventResultConfigs"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventResultEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("EventId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("RequiresRecalculation") + .HasColumnType("tinyint(1)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "EventId"); + + b.HasIndex("EventId"); + + b.ToTable("EventResults"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.FilterOptionEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("FilterOptionId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ChampSeasonId") + .HasColumnType("bigint"); + + b.Property("Conditions") + .IsRequired() + .HasColumnType("json"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("PointFilterResultConfigId") + .HasColumnType("bigint"); + + b.Property("ResultFilterResultConfigId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "FilterOptionId"); + + b.HasAlternateKey("FilterOptionId"); + + b.HasIndex("LeagueId", "ChampSeasonId"); + + b.HasIndex("LeagueId", "PointFilterResultConfigId"); + + b.HasIndex("LeagueId", "ResultFilterResultConfigId"); + + b.ToTable("FilterOptions"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IncidentReviewEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ReviewId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AuthorName") + .HasColumnType("longtext"); + + b.Property("AuthorUserId") + .HasColumnType("longtext"); + + b.Property("Corner") + .HasColumnType("longtext"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("FullDescription") + .HasColumnType("longtext"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("IncidentKind") + .HasColumnType("longtext"); + + b.Property("IncidentNr") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("OnLap") + .HasColumnType("longtext"); + + b.Property("ResultLongText") + .HasColumnType("longtext"); + + b.Property("SessionId") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ReviewId"); + + b.HasAlternateKey("ReviewId"); + + b.HasIndex("SessionId"); + + b.HasIndex("LeagueId", "SessionId"); + + b.ToTable("IncidentReviews"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IncidentReviewsInvolvedTeams", b => + { + b.Property("ReviewRefId") + .HasColumnType("bigint"); + + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("TeamRefId") + .HasColumnType("bigint"); + + b.HasKey("ReviewRefId", "LeagueId", "TeamRefId"); + + b.HasIndex("LeagueId", "ReviewRefId"); + + b.HasIndex("LeagueId", "TeamRefId"); + + b.ToTable("IncidentReviewsInvolvedTeams"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IRSimSessionDetailsEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("SessionDetailsId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ConfigName") + .HasColumnType("longtext"); + + b.Property("CornersPerLap") + .HasColumnType("int"); + + b.Property("DamageModel") + .HasColumnType("int"); + + b.Property("EndTime") + .HasColumnType("datetime"); + + b.Property("EventAverageLap") + .HasColumnType("bigint"); + + b.Property("EventId") + .HasColumnType("bigint"); + + b.Property("EventLapsComplete") + .HasColumnType("int"); + + b.Property("EventStrengthOfField") + .HasColumnType("int"); + + b.Property("Fog") + .HasColumnType("int"); + + b.Property("IRRaceWeek") + .HasColumnType("int"); + + b.Property("IRSeasonId") + .HasColumnType("bigint"); + + b.Property("IRSeasonName") + .HasColumnType("longtext"); + + b.Property("IRSeasonQuarter") + .HasColumnType("int"); + + b.Property("IRSeasonYear") + .HasColumnType("int"); + + b.Property("IRSessionId") + .HasColumnType("bigint"); + + b.Property("IRSubsessionId") + .HasColumnType("bigint"); + + b.Property("IRTrackId") + .HasColumnType("int"); + + b.Property("KmDistPerLap") + .HasColumnType("double"); + + b.Property("LeaveMarbles") + .HasColumnType("tinyint(1)"); + + b.Property("LicenseCategory") + .HasColumnType("int"); + + b.Property("MaxWeeks") + .HasColumnType("int"); + + b.Property("NumCautionLaps") + .HasColumnType("int"); + + b.Property("NumCautions") + .HasColumnType("int"); + + b.Property("NumLeadChanges") + .HasColumnType("int"); + + b.Property("PracticeGripCompound") + .HasColumnType("int"); + + b.Property("PracticeRubber") + .HasColumnType("int"); + + b.Property("QualifyGripCompund") + .HasColumnType("int"); + + b.Property("QualifyRubber") + .HasColumnType("int"); + + b.Property("RaceGripCompound") + .HasColumnType("int"); + + b.Property("RaceRubber") + .HasColumnType("int"); + + b.Property("RelHumidity") + .HasColumnType("int"); + + b.Property("SessionName") + .HasColumnType("longtext"); + + b.Property("SimStartUtcOffset") + .HasColumnType("bigint"); + + b.Property("SimStartUtcTime") + .HasColumnType("datetime"); + + b.Property("Skies") + .HasColumnType("int"); + + b.Property("StartTime") + .HasColumnType("datetime"); + + b.Property("TempUnits") + .HasColumnType("int"); + + b.Property("TempValue") + .HasColumnType("int"); + + b.Property("TimeOfDay") + .HasColumnType("int"); + + b.Property("TrackCategoryId") + .HasColumnType("int"); + + b.Property("TrackName") + .HasColumnType("longtext"); + + b.Property("WarmupGripCompound") + .HasColumnType("int"); + + b.Property("WarmupRubber") + .HasColumnType("int"); + + b.Property("WeatherType") + .HasColumnType("int"); + + b.Property("WeatherVarInitial") + .HasColumnType("int"); + + b.Property("WeatherVarOngoing") + .HasColumnType("int"); + + b.Property("WindDir") + .HasColumnType("int"); + + b.Property("WindUnits") + .HasColumnType("int"); + + b.HasKey("LeagueId", "SessionDetailsId"); + + b.HasAlternateKey("SessionDetailsId"); + + b.HasIndex("LeagueId", "EventId"); + + b.ToTable("IRSimSessionDetails"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.LeagueEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DescriptionPlain") + .HasColumnType("longtext"); + + b.Property("EnableLiveReviews") + .HasColumnType("tinyint(1)"); + + b.Property("EnableProtests") + .HasColumnType("tinyint(1)"); + + b.Property("Expires") + .HasColumnType("datetime(6)"); + + b.Property("IsInitialized") + .HasColumnType("tinyint(1)"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime(6)"); + + b.Property("LeaguePublic") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(85) + .HasColumnType("varchar(85)"); + + b.Property("NameFull") + .HasColumnType("longtext"); + + b.Property("ProtestCoolDownPeriod") + .HasColumnType("bigint"); + + b.Property("ProtestFormAccess") + .HasColumnType("int"); + + b.Property("ProtestsClosedAfter") + .HasColumnType("bigint"); + + b.Property("ProtestsPublic") + .HasColumnType("int"); + + b.Property("Subscription") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasAlternateKey("Name"); + + b.ToTable("Leagues"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.LeagueMemberEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("MemberId") + .HasColumnType("bigint"); + + b.Property("TeamId") + .HasColumnType("bigint"); + + b.HasKey("LeagueId", "MemberId"); + + b.HasIndex("MemberId"); + + b.HasIndex("LeagueId", "TeamId"); + + b.ToTable("LeagueMembers"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.MemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("DanLisaId") + .HasColumnType("longtext"); + + b.Property("DiscordId") + .HasColumnType("longtext"); + + b.Property("Firstname") + .HasColumnType("longtext"); + + b.Property("IRacingId") + .HasColumnType("longtext"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("Lastname") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("Members"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.PaymentEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("LastPaymentReceived") + .HasColumnType("datetime(6)"); + + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("NextPaymentDue") + .HasColumnType("datetime(6)"); + + b.Property("PlanId") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SubscriptionId") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("LeagueId"); + + b.HasIndex("PlanId"); + + b.ToTable("Payments", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.PointRuleEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("PointRuleId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BonusPoints") + .IsRequired() + .HasColumnType("json"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("FinalSortOptions") + .HasColumnType("longtext"); + + b.Property("Formula") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("MaxPoints") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PointDropOff") + .HasColumnType("int"); + + b.Property("PointsPerPlace") + .HasColumnType("longtext"); + + b.Property("PointsSortOptions") + .HasColumnType("longtext"); + + b.Property("RuleType") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "PointRuleId"); + + b.HasAlternateKey("PointRuleId"); + + b.ToTable("PointRules"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ProtestEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ProtestId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AuthorMemberId") + .HasColumnType("bigint"); + + b.Property("Corner") + .HasColumnType("longtext"); + + b.Property("FullDescription") + .HasColumnType("longtext"); + + b.Property("OnLap") + .HasColumnType("longtext"); + + b.Property("SessionId") + .HasColumnType("bigint"); + + b.HasKey("LeagueId", "ProtestId"); + + b.HasAlternateKey("ProtestId"); + + b.HasIndex("LeagueId", "AuthorMemberId"); + + b.HasIndex("LeagueId", "SessionId"); + + b.ToTable("Protests", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.Protests_LeagueMembers", b => + { + b.Property("MemberId") + .HasColumnType("bigint"); + + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ProtestId") + .HasColumnType("bigint"); + + b.HasKey("MemberId", "LeagueId", "ProtestId"); + + b.HasIndex("LeagueId", "MemberId"); + + b.HasIndex("LeagueId", "ProtestId"); + + b.ToTable("Protests_LeagueMembers"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ResultConfigId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ChampSeasonId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ResultsPerTeam") + .HasColumnType("int"); + + b.Property("SourceResultConfigId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ResultConfigId"); + + b.HasAlternateKey("ResultConfigId"); + + b.HasIndex("LeagueId", "ChampSeasonId"); + + b.HasIndex("LeagueId", "SourceResultConfigId"); + + b.ToTable("ResultConfigurations"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ResultRowEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ResultRowId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AvgLapTime") + .HasColumnType("bigint"); + + b.Property("Car") + .HasColumnType("longtext"); + + b.Property("CarClass") + .HasColumnType("longtext"); + + b.Property("CarId") + .HasColumnType("int"); + + b.Property("CarNumber") + .HasMaxLength(8) + .HasColumnType("varchar(8)"); + + b.Property("ClassId") + .HasColumnType("int"); + + b.Property("ClubId") + .HasColumnType("int"); + + b.Property("ClubName") + .HasColumnType("longtext"); + + b.Property("CompletedLaps") + .HasColumnType("double"); + + b.Property("CompletedPct") + .HasColumnType("double"); + + b.Property("ContactLaps") + .HasColumnType("longtext"); + + b.Property("Division") + .HasColumnType("int"); + + b.Property("FastLapNr") + .HasColumnType("int"); + + b.Property("FastestLapTime") + .HasColumnType("bigint"); + + b.Property("FinishPosition") + .HasColumnType("double"); + + b.Property("IRacingId") + .HasColumnType("longtext"); + + b.Property("Incidents") + .HasColumnType("double"); + + b.Property("Interval") + .HasColumnType("bigint"); + + b.Property("LeadLaps") + .HasColumnType("double"); + + b.Property("License") + .HasColumnType("longtext"); + + b.Property("MemberId") + .HasColumnType("bigint"); + + b.Property("NewCpi") + .HasColumnType("int"); + + b.Property("NewIRating") + .HasColumnType("int"); + + b.Property("NewLicenseLevel") + .HasColumnType("int"); + + b.Property("NewSafetyRating") + .HasColumnType("double"); + + b.Property("NumContactLaps") + .HasColumnType("int"); + + b.Property("NumOfftrackLaps") + .HasColumnType("int"); + + b.Property("NumPitStops") + .HasColumnType("int"); + + b.Property("OfftrackLaps") + .HasColumnType("longtext"); + + b.Property("OldCpi") + .HasColumnType("int"); + + b.Property("OldIRating") + .HasColumnType("int"); + + b.Property("OldLicenseLevel") + .HasColumnType("int"); + + b.Property("OldSafetyRating") + .HasColumnType("double"); + + b.Property("PittedLaps") + .HasColumnType("longtext"); + + b.Property("PointsEligible") + .HasColumnType("tinyint(1)"); + + b.Property("PositionChange") + .HasColumnType("double"); + + b.Property("QualifyingTime") + .HasColumnType("bigint"); + + b.Property("QualifyingTimeAt") + .HasColumnType("datetime"); + + b.Property("RacePoints") + .HasColumnType("double"); + + b.Property("SeasonStartIRating") + .HasColumnType("int"); + + b.Property("SimSessionType") + .HasColumnType("int"); + + b.Property("StartPosition") + .HasColumnType("double"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("SubSessionId") + .HasColumnType("bigint"); + + b.Property("TeamId") + .HasColumnType("bigint"); + + b.HasKey("LeagueId", "ResultRowId"); + + b.HasAlternateKey("ResultRowId"); + + b.HasIndex("MemberId"); + + b.HasIndex("LeagueId", "MemberId"); + + b.HasIndex("LeagueId", "SubSessionId"); + + b.HasIndex("LeagueId", "TeamId"); + + b.ToTable("ResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewCommentEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("CommentId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AuthorName") + .HasColumnType("longtext"); + + b.Property("AuthorUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("Date") + .HasColumnType("datetime"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("ReplyToCommentId") + .HasColumnType("bigint"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("Text") + .HasColumnType("longtext"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "CommentId"); + + b.HasAlternateKey("CommentId"); + + b.HasIndex("ReplyToCommentId"); + + b.HasIndex("ReviewId"); + + b.HasIndex("LeagueId", "ReplyToCommentId"); + + b.HasIndex("LeagueId", "ReviewId"); + + b.ToTable("ReviewComments"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewCommentVoteEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ReviewVoteId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CommentId") + .HasColumnType("bigint"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("MemberAtFaultId") + .HasColumnType("bigint"); + + b.Property("TeamAtFaultId") + .HasColumnType("bigint"); + + b.Property("VoteCategoryId") + .HasColumnType("bigint"); + + b.HasKey("LeagueId", "ReviewVoteId"); + + b.HasAlternateKey("ReviewVoteId"); + + b.HasIndex("CommentId"); + + b.HasIndex("MemberAtFaultId"); + + b.HasIndex("VoteCategoryId"); + + b.HasIndex("LeagueId", "CommentId"); + + b.HasIndex("LeagueId", "TeamAtFaultId"); + + b.HasIndex("LeagueId", "VoteCategoryId"); + + b.ToTable("ReviewCommentVotes"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewPenaltyEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ResultRowId") + .HasColumnType("bigint"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("ReviewVoteId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("json"); + + b.HasKey("LeagueId", "ResultRowId", "ReviewId", "ReviewVoteId"); + + b.HasIndex("ReviewId"); + + b.HasIndex("ReviewVoteId"); + + b.HasIndex("LeagueId", "ResultRowId"); + + b.HasIndex("LeagueId", "ReviewId"); + + b.HasIndex("LeagueId", "ReviewVoteId"); + + b.ToTable("ReviewPenaltys"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScheduleEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ScheduleId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("SeasonId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ScheduleId"); + + b.HasAlternateKey("ScheduleId"); + + b.HasIndex("LeagueId", "SeasonId"); + + b.ToTable("Schedules"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredEventResultEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ResultId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ChampSeasonId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("EventId") + .HasColumnType("bigint"); + + b.Property("EventResultEntityEventId") + .HasColumnType("bigint"); + + b.Property("EventResultEntityLeagueId") + .HasColumnType("bigint"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ResultConfigId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ResultId"); + + b.HasAlternateKey("ResultId"); + + b.HasIndex("EventResultEntityLeagueId", "EventResultEntityEventId"); + + b.HasIndex("LeagueId", "ChampSeasonId"); + + b.HasIndex("LeagueId", "EventId"); + + b.HasIndex("LeagueId", "ResultConfigId"); + + b.ToTable("ScoredEventResults"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ScoredResultRowId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AvgLapTime") + .HasColumnType("bigint"); + + b.Property("BonusPoints") + .HasColumnType("double"); + + b.Property("Car") + .HasColumnType("longtext"); + + b.Property("CarClass") + .HasColumnType("longtext"); + + b.Property("CarId") + .HasColumnType("int"); + + b.Property("CarNumber") + .HasMaxLength(8) + .HasColumnType("varchar(8)"); + + b.Property("ClassId") + .HasColumnType("int"); + + b.Property("ClubId") + .HasColumnType("int"); + + b.Property("ClubName") + .HasColumnType("longtext"); + + b.Property("CompletedLaps") + .HasColumnType("double"); + + b.Property("CompletedPct") + .HasColumnType("double"); + + b.Property("ContactLaps") + .HasColumnType("longtext"); + + b.Property("Division") + .HasColumnType("int"); + + b.Property("FastLapNr") + .HasColumnType("int"); + + b.Property("FastestLapTime") + .HasColumnType("bigint"); + + b.Property("FinalPosition") + .HasColumnType("int"); + + b.Property("FinalPositionChange") + .HasColumnType("double"); + + b.Property("FinishPosition") + .HasColumnType("double"); + + b.Property("IRacingId") + .HasColumnType("longtext"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("Incidents") + .HasColumnType("double"); + + b.Property("Interval") + .HasColumnType("bigint"); + + b.Property("LeadLaps") + .HasColumnType("double"); + + b.Property("License") + .HasColumnType("longtext"); + + b.Property("MemberId") + .HasColumnType("bigint"); + + b.Property("NewCpi") + .HasColumnType("int"); + + b.Property("NewIRating") + .HasColumnType("int"); + + b.Property("NewLicenseLevel") + .HasColumnType("int"); + + b.Property("NewSafetyRating") + .HasColumnType("double"); + + b.Property("NumContactLaps") + .HasColumnType("int"); + + b.Property("NumOfftrackLaps") + .HasColumnType("int"); + + b.Property("NumPitStops") + .HasColumnType("int"); + + b.Property("OfftrackLaps") + .HasColumnType("longtext"); + + b.Property("OldCpi") + .HasColumnType("int"); + + b.Property("OldIRating") + .HasColumnType("int"); + + b.Property("OldLicenseLevel") + .HasColumnType("int"); + + b.Property("OldSafetyRating") + .HasColumnType("double"); + + b.Property("PenaltyPoints") + .HasColumnType("double"); + + b.Property("PittedLaps") + .HasColumnType("longtext"); + + b.Property("PointsEligible") + .HasColumnType("tinyint(1)"); + + b.Property("PositionChange") + .HasColumnType("double"); + + b.Property("QualifyingTime") + .HasColumnType("bigint"); + + b.Property("QualifyingTimeAt") + .HasColumnType("datetime"); + + b.Property("RacePoints") + .HasColumnType("double"); + + b.Property("SeasonStartIRating") + .HasColumnType("int"); + + b.Property("SessionResultId") + .HasColumnType("bigint"); + + b.Property("SimSessionType") + .HasColumnType("int"); + + b.Property("StartPosition") + .HasColumnType("double"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TeamId") + .HasColumnType("bigint"); + + b.Property("TotalPoints") + .HasColumnType("double"); + + b.HasKey("LeagueId", "ScoredResultRowId"); + + b.HasAlternateKey("ScoredResultRowId"); + + b.HasIndex("MemberId"); + + b.HasIndex("TeamId"); + + b.HasIndex("LeagueId", "SessionResultId"); + + b.HasIndex("LeagueId", "TeamId"); + + b.ToTable("ScoredResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredSessionResultEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("SessionResultId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("Discriminator") + .HasColumnType("longtext"); + + b.Property("FastestAvgLap") + .HasColumnType("bigint"); + + b.Property("FastestAvgLapDriverMemberId") + .HasColumnType("bigint"); + + b.Property("FastestLap") + .HasColumnType("bigint"); + + b.Property("FastestLapDriverMemberId") + .HasColumnType("bigint"); + + b.Property("FastestQualyLap") + .HasColumnType("bigint"); + + b.Property("FastestQualyLapDriverMemberId") + .HasColumnType("bigint"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ResultId") + .HasColumnType("bigint"); + + b.Property("ScoringId") + .HasColumnType("bigint"); + + b.Property("SessionNr") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "SessionResultId"); + + b.HasAlternateKey("SessionResultId"); + + b.HasIndex("FastestAvgLapDriverMemberId"); + + b.HasIndex("FastestLapDriverMemberId"); + + b.HasIndex("FastestQualyLapDriverMemberId"); + + b.HasIndex("LeagueId", "ResultId"); + + b.HasIndex("LeagueId", "ScoringId"); + + b.ToTable("ScoredSessionResults"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredTeamResultRowsResultRows", b => + { + b.Property("TeamParentRowRefId") + .HasColumnType("bigint"); + + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("TeamResultRowRefId") + .HasColumnType("bigint"); + + b.HasKey("TeamParentRowRefId", "LeagueId", "TeamResultRowRefId"); + + b.HasIndex("LeagueId", "TeamParentRowRefId"); + + b.HasIndex("LeagueId", "TeamResultRowRefId"); + + b.ToTable("ScoredTeamResultRowsResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoringEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("ScoringId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("ExtScoringSourceId") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsCombinedResult") + .HasColumnType("tinyint(1)"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("MaxResultsPerGroup") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PointsRuleId") + .HasColumnType("bigint"); + + b.Property("ResultConfigId") + .HasColumnType("bigint"); + + b.Property("ScheduleEntityLeagueId") + .HasColumnType("bigint"); + + b.Property("ScheduleEntityScheduleId") + .HasColumnType("bigint"); + + b.Property("ShowResults") + .HasColumnType("tinyint(1)"); + + b.Property("UpdateTeamOnRecalculation") + .HasColumnType("tinyint(1)"); + + b.Property("UseExternalSourcePoints") + .HasColumnType("tinyint(1)"); + + b.Property("UseResultSetTeam") + .HasColumnType("tinyint(1)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "ScoringId"); + + b.HasAlternateKey("ScoringId"); + + b.HasIndex("ExtScoringSourceId"); + + b.HasIndex("LeagueId", "ExtScoringSourceId"); + + b.HasIndex("LeagueId", "PointsRuleId"); + + b.HasIndex("LeagueId", "ResultConfigId"); + + b.HasIndex("ScheduleEntityLeagueId", "ScheduleEntityScheduleId"); + + b.ToTable("Scorings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SeasonEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("SeasonId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("Finished") + .HasColumnType("tinyint(1)"); + + b.Property("HideCommentsBeforeVoted") + .HasColumnType("tinyint(1)"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("MainScoringLeagueId") + .HasColumnType("bigint"); + + b.Property("MainScoringScoringId") + .HasColumnType("bigint"); + + b.Property("SeasonEnd") + .HasColumnType("datetime"); + + b.Property("SeasonName") + .HasColumnType("longtext"); + + b.Property("SeasonStart") + .HasColumnType("datetime"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "SeasonId"); + + b.HasAlternateKey("SeasonId"); + + b.HasIndex("MainScoringLeagueId", "MainScoringScoringId"); + + b.ToTable("Seasons"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SessionEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("SessionId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("Duration") + .HasColumnType("bigint"); + + b.Property("EventId") + .HasColumnType("bigint"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("Laps") + .HasColumnType("int"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("SessionNr") + .HasColumnType("int"); + + b.Property("SessionType") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StartOffset") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "SessionId"); + + b.HasAlternateKey("SessionId"); + + b.HasIndex("EventId", "SessionId"); + + b.HasIndex("LeagueId", "EventId"); + + b.ToTable("Sessions"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SessionResultEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("SessionId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("EventId") + .HasColumnType("bigint"); + + b.Property("IRSimSessionDetailsId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime(6)"); + + b.Property("SimSessionType") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "SessionId"); + + b.HasIndex("SessionId"); + + b.HasIndex("LeagueId", "EventId"); + + b.HasIndex("LeagueId", "IRSimSessionDetailsId"); + + b.ToTable("SessionResults"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingConfigurationEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("StandingConfigId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ResultKind") + .HasColumnType("int"); + + b.Property("SortOptions") + .HasColumnType("longtext"); + + b.Property("UseCombinedResult") + .HasColumnType("tinyint(1)"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WeeksCounted") + .HasColumnType("int"); + + b.HasKey("LeagueId", "StandingConfigId"); + + b.HasAlternateKey("StandingConfigId"); + + b.ToTable("StandingConfigurations"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("StandingId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ChampSeasonId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime(6)"); + + b.Property("EventId") + .HasColumnType("bigint"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("IsTeamStanding") + .HasColumnType("tinyint(1)"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("SeasonId") + .HasColumnType("bigint"); + + b.Property("StandingConfigId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "StandingId"); + + b.HasAlternateKey("StandingId"); + + b.HasIndex("LeagueId", "ChampSeasonId"); + + b.HasIndex("LeagueId", "EventId"); + + b.HasIndex("LeagueId", "SeasonId"); + + b.HasIndex("LeagueId", "StandingConfigId"); + + b.ToTable("Standings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingRowEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("StandingRowId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CarClass") + .HasColumnType("longtext"); + + b.Property("ClassId") + .HasColumnType("int"); + + b.Property("CompletedLaps") + .HasColumnType("int"); + + b.Property("CompletedLapsChange") + .HasColumnType("int"); + + b.Property("DroppedResultCount") + .HasColumnType("int"); + + b.Property("FastestLaps") + .HasColumnType("int"); + + b.Property("FastestLapsChange") + .HasColumnType("int"); + + b.Property("Incidents") + .HasColumnType("int"); + + b.Property("IncidentsChange") + .HasColumnType("int"); + + b.Property("LastIrating") + .HasColumnType("int"); + + b.Property("LastPosition") + .HasColumnType("int"); + + b.Property("LeadLaps") + .HasColumnType("int"); + + b.Property("LeadLapsChange") + .HasColumnType("int"); + + b.Property("MemberId") + .HasColumnType("bigint"); + + b.Property("PenaltyPoints") + .HasColumnType("int"); + + b.Property("PenaltyPointsChange") + .HasColumnType("int"); + + b.Property("PolePositions") + .HasColumnType("int"); + + b.Property("PolePositionsChange") + .HasColumnType("int"); + + b.Property("Position") + .HasColumnType("int"); + + b.Property("PositionChange") + .HasColumnType("int"); + + b.Property("RacePoints") + .HasColumnType("int"); + + b.Property("RacePointsChange") + .HasColumnType("int"); + + b.Property("Races") + .HasColumnType("int"); + + b.Property("RacesCounted") + .HasColumnType("int"); + + b.Property("RacesInPoints") + .HasColumnType("int"); + + b.Property("RacesScored") + .HasColumnType("int"); + + b.Property("StandingId") + .HasColumnType("bigint"); + + b.Property("StartIrating") + .HasColumnType("int"); + + b.Property("TeamId") + .HasColumnType("bigint"); + + b.Property("Top10") + .HasColumnType("int"); + + b.Property("Top3") + .HasColumnType("int"); + + b.Property("Top5") + .HasColumnType("int"); + + b.Property("TotalPoints") + .HasColumnType("int"); + + b.Property("TotalPointsChange") + .HasColumnType("int"); + + b.Property("Wins") + .HasColumnType("int"); + + b.Property("WinsChange") + .HasColumnType("int"); + + b.HasKey("LeagueId", "StandingRowId"); + + b.HasAlternateKey("StandingRowId"); + + b.HasIndex("MemberId"); + + b.HasIndex("LeagueId", "StandingId"); + + b.HasIndex("LeagueId", "TeamId"); + + b.ToTable("StandingRows", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingRows_ScoredResultRows", b => + { + b.Property("ScoredResultRowRefId") + .HasColumnType("bigint"); + + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("StandingRowRefId") + .HasColumnType("bigint"); + + b.Property("IsScored") + .HasColumnType("tinyint(1)"); + + b.HasKey("ScoredResultRowRefId", "LeagueId", "StandingRowRefId"); + + b.HasIndex("LeagueId", "ScoredResultRowRefId"); + + b.HasIndex("LeagueId", "StandingRowRefId"); + + b.ToTable("StandingRows_ScoredResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StatisticSetEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("CurrentChampId") + .HasColumnType("bigint"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("FinishedRaces") + .HasColumnType("int"); + + b.Property("FirstDate") + .HasColumnType("datetime"); + + b.Property("ImportSource") + .HasColumnType("longtext"); + + b.Property("IsSeasonFinished") + .HasColumnType("tinyint(1)"); + + b.Property("LastDate") + .HasColumnType("datetime"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("RequiresRecalculation") + .HasColumnType("tinyint(1)"); + + b.Property("SeasonId") + .HasColumnType("bigint"); + + b.Property("StandingId") + .HasColumnType("bigint"); + + b.Property("UpdateInterval") + .HasColumnType("bigint"); + + b.Property("UpdateTime") + .HasColumnType("datetime"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "Id"); + + b.HasAlternateKey("Id"); + + b.HasIndex("CurrentChampId"); + + b.HasIndex("LeagueId", "SeasonId"); + + b.HasIndex("LeagueId", "StandingId"); + + b.ToTable("StatisticSets"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SubscriptionEntity", b => + { + b.Property("PlanId") + .HasColumnType("varchar(255)"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Price") + .HasColumnType("double"); + + b.HasKey("PlanId"); + + b.ToTable("Subscriptions", (string)null); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TeamEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("TeamId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreatedByUserId") + .HasColumnType("longtext"); + + b.Property("CreatedByUserName") + .HasColumnType("longtext"); + + b.Property("CreatedOn") + .HasColumnType("datetime"); + + b.Property("IRacingTeamId") + .HasColumnType("bigint"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserId") + .HasColumnType("longtext"); + + b.Property("LastModifiedByUserName") + .HasColumnType("longtext"); + + b.Property("LastModifiedOn") + .HasColumnType("datetime"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Profile") + .HasColumnType("longtext"); + + b.Property("TeamColor") + .HasColumnType("longtext"); + + b.Property("TeamHomepage") + .HasColumnType("longtext"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("LeagueId", "TeamId"); + + b.HasAlternateKey("TeamId"); + + b.ToTable("Teams"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TrackConfigEntity", b => + { + b.Property("TrackId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConfigName") + .HasColumnType("longtext"); + + b.Property("ConfigType") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("HasNightLighting") + .HasColumnType("tinyint(1)"); + + b.Property("LegacyTrackId") + .HasColumnType("longtext"); + + b.Property("LengthKm") + .HasColumnType("double"); + + b.Property("TrackGroupId") + .HasColumnType("bigint"); + + b.Property("Turns") + .HasColumnType("int"); + + b.HasKey("TrackId"); + + b.HasIndex("TrackGroupId"); + + b.ToTable("TrackConfigs"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TrackGroupEntity", b => + { + b.Property("TrackGroupId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Location") + .HasColumnType("longtext"); + + b.Property("TrackName") + .HasColumnType("longtext"); + + b.HasKey("TrackGroupId"); + + b.ToTable("TrackGroups"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.VoteCategoryEntity", b => + { + b.Property("LeagueId") + .HasColumnType("bigint"); + + b.Property("CatId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("DefaultPenalty") + .HasColumnType("int"); + + b.Property("ImportId") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("Text") + .HasColumnType("longtext"); + + b.HasKey("LeagueId", "CatId"); + + b.HasAlternateKey("CatId"); + + b.ToTable("VoteCategories"); + }); + + modelBuilder.Entity("MemberEntityScoredSessionResultEntity", b => + { + b.Property("CleanestDriversId") + .HasColumnType("bigint"); + + b.Property("CleanestDriverResultsLeagueId") + .HasColumnType("bigint"); + + b.Property("CleanestDriverResultsSessionResultId") + .HasColumnType("bigint"); + + b.HasKey("CleanestDriversId", "CleanestDriverResultsLeagueId", "CleanestDriverResultsSessionResultId"); + + b.HasIndex("CleanestDriverResultsLeagueId", "CleanestDriverResultsSessionResultId"); + + b.ToTable("ScoredResultsCleanestDrivers", (string)null); + }); + + modelBuilder.Entity("MemberEntityScoredSessionResultEntity1", b => + { + b.Property("HardChargersId") + .HasColumnType("bigint"); + + b.Property("HardChargerResultsLeagueId") + .HasColumnType("bigint"); + + b.Property("HardChargerResultsSessionResultId") + .HasColumnType("bigint"); + + b.HasKey("HardChargersId", "HardChargerResultsLeagueId", "HardChargerResultsSessionResultId"); + + b.HasIndex("HardChargerResultsLeagueId", "HardChargerResultsSessionResultId"); + + b.ToTable("ScoredResultsHardChargers", (string)null); + }); + + modelBuilder.Entity("StatisticSetEntityStatisticSetEntity", b => + { + b.Property("DependendStatisticSetsLeagueId") + .HasColumnType("bigint"); + + b.Property("DependendStatisticSetsId") + .HasColumnType("bigint"); + + b.Property("LeagueStatisticSetsLeagueId") + .HasColumnType("bigint"); + + b.Property("LeagueStatisticSetsId") + .HasColumnType("bigint"); + + b.HasKey("DependendStatisticSetsLeagueId", "DependendStatisticSetsId", "LeagueStatisticSetsLeagueId", "LeagueStatisticSetsId"); + + b.HasIndex("LeagueStatisticSetsLeagueId", "LeagueStatisticSetsId"); + + b.ToTable("LeagueStatisticSetsStatisticSets", (string)null); + }); + + modelBuilder.Entity("IncidentReviewEntityMemberEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", null) + .WithMany() + .HasForeignKey("InvolvedMembersId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.IncidentReviewEntity", null) + .WithMany() + .HasForeignKey("InvolvedReviewsLeagueId", "InvolvedReviewsReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AcceptedReviewVoteEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "MemberAtFault") + .WithMany("AcceptedReviewVotes") + .HasForeignKey("MemberAtFaultId"); + + b.HasOne("iRLeagueDatabaseCore.Models.IncidentReviewEntity", "Review") + .WithMany("AcceptedReviewVotes") + .HasForeignKey("LeagueId", "ReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "TeamAtFault") + .WithMany() + .HasForeignKey("LeagueId", "TeamAtFaultId"); + + b.HasOne("iRLeagueDatabaseCore.Models.VoteCategoryEntity", "VoteCategory") + .WithMany("AcceptedReviewVotes") + .HasForeignKey("LeagueId", "VoteCategoryId"); + + b.Navigation("MemberAtFault"); + + b.Navigation("Review"); + + b.Navigation("TeamAtFault"); + + b.Navigation("VoteCategory"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AddPenaltyEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "ScoredResultRow") + .WithMany("AddPenalties") + .HasForeignKey("LeagueId", "ScoredResultRowId") + .OnDelete(DeleteBehavior.ClientCascade) + .IsRequired(); + + b.Navigation("ScoredResultRow"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AutoPenaltyConfigEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.PointRuleEntity", "PointRule") + .WithMany("AutoPenalties") + .HasForeignKey("LeagueId", "PointRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PointRule"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ChampionshipEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("Championships") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("League"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ChampSeasonEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ChampionshipEntity", "Championship") + .WithMany("ChampSeasons") + .HasForeignKey("LeagueId", "ChampionshipId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "DefaultResultConfig") + .WithMany() + .HasForeignKey("LeagueId", "DefaultResultConfigId"); + + b.HasOne("iRLeagueDatabaseCore.Models.SeasonEntity", "Season") + .WithMany("ChampSeasons") + .HasForeignKey("LeagueId", "SeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.StandingConfigurationEntity", "StandingConfiguration") + .WithMany("ChampSeasons") + .HasForeignKey("LeagueId", "StandingConfigId"); + + b.Navigation("Championship"); + + b.Navigation("DefaultResultConfig"); + + b.Navigation("Season"); + + b.Navigation("StandingConfiguration"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.CustomIncidentEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany() + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("League"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.DriverStatisticRowEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "Member") + .WithMany("DriverStatisticRows") + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "FirstRace") + .WithMany() + .HasForeignKey("LeagueId", "FirstRaceId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "FirstResultRow") + .WithMany() + .HasForeignKey("LeagueId", "FirstResultRowId"); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "FirstSession") + .WithMany() + .HasForeignKey("LeagueId", "FirstSessionId"); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "LastRace") + .WithMany() + .HasForeignKey("LeagueId", "LastRaceId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "LastResultRow") + .WithMany() + .HasForeignKey("LeagueId", "LastResultRowId"); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "LastSession") + .WithMany() + .HasForeignKey("LeagueId", "LastSessionId"); + + b.HasOne("iRLeagueDatabaseCore.Models.StatisticSetEntity", "StatisticSet") + .WithMany("DriverStatisticRows") + .HasForeignKey("LeagueId", "StatisticSetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FirstRace"); + + b.Navigation("FirstResultRow"); + + b.Navigation("FirstSession"); + + b.Navigation("LastRace"); + + b.Navigation("LastResultRow"); + + b.Navigation("LastSession"); + + b.Navigation("Member"); + + b.Navigation("StatisticSet"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.TrackConfigEntity", "Track") + .WithMany() + .HasForeignKey("TrackId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("iRLeagueDatabaseCore.Models.ScheduleEntity", "Schedule") + .WithMany("Events") + .HasForeignKey("LeagueId", "ScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Schedule"); + + b.Navigation("Track"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventResultConfigs", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.EventEntity", "Event") + .WithMany() + .HasForeignKey("LeagueId", "EventRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "ResultConfig") + .WithMany() + .HasForeignKey("LeagueId", "ResultConfigRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + + b.Navigation("ResultConfig"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventResultEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.EventEntity", "Event") + .WithOne("EventResult") + .HasForeignKey("iRLeagueDatabaseCore.Models.EventResultEntity", "LeagueId", "EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.FilterOptionEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ChampSeasonEntity", "ChampSeason") + .WithMany("Filters") + .HasForeignKey("LeagueId", "ChampSeasonId") + .OnDelete(DeleteBehavior.ClientCascade); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "PointFilterResultConfig") + .WithMany("PointFilters") + .HasForeignKey("LeagueId", "PointFilterResultConfigId") + .OnDelete(DeleteBehavior.ClientCascade); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "ResultFilterResultConfig") + .WithMany("ResultFilters") + .HasForeignKey("LeagueId", "ResultFilterResultConfigId") + .OnDelete(DeleteBehavior.ClientCascade); + + b.Navigation("ChampSeason"); + + b.Navigation("PointFilterResultConfig"); + + b.Navigation("ResultFilterResultConfig"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IncidentReviewEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "Session") + .WithMany("IncidentReviews") + .HasForeignKey("LeagueId", "SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IncidentReviewsInvolvedTeams", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.IncidentReviewEntity", "Review") + .WithMany() + .HasForeignKey("LeagueId", "ReviewRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "Team") + .WithMany() + .HasForeignKey("LeagueId", "TeamRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IRSimSessionDetailsEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.EventEntity", "Event") + .WithMany("SimSessionDetails") + .HasForeignKey("LeagueId", "EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.LeagueMemberEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("LeagueMembers") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "Member") + .WithMany() + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "Team") + .WithMany("Members") + .HasForeignKey("LeagueId", "TeamId"); + + b.Navigation("League"); + + b.Navigation("Member"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.PaymentEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("Payments") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.SubscriptionEntity", "Subscription") + .WithMany("Payments") + .HasForeignKey("PlanId"); + + b.Navigation("League"); + + b.Navigation("Subscription"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.PointRuleEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("PointRules") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("League"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ProtestEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueMemberEntity", "Author") + .WithMany() + .HasForeignKey("LeagueId", "AuthorMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "Session") + .WithMany() + .HasForeignKey("LeagueId", "SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.Protests_LeagueMembers", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueMemberEntity", "Member") + .WithMany() + .HasForeignKey("LeagueId", "MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ProtestEntity", "Protest") + .WithMany() + .HasForeignKey("LeagueId", "ProtestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Member"); + + b.Navigation("Protest"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("ResultConfigs") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ChampSeasonEntity", "ChampSeason") + .WithMany("ResultConfigurations") + .HasForeignKey("LeagueId", "ChampSeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "SourceResultConfig") + .WithMany() + .HasForeignKey("LeagueId", "SourceResultConfigId"); + + b.Navigation("ChampSeason"); + + b.Navigation("League"); + + b.Navigation("SourceResultConfig"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ResultRowEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "Member") + .WithMany("ResultRows") + .HasForeignKey("MemberId") + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.LeagueMemberEntity", "LeagueMember") + .WithMany() + .HasForeignKey("LeagueId", "MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionResultEntity", "SubResult") + .WithMany("ResultRows") + .HasForeignKey("LeagueId", "SubSessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "Team") + .WithMany() + .HasForeignKey("LeagueId", "TeamId"); + + b.Navigation("LeagueMember"); + + b.Navigation("Member"); + + b.Navigation("SubResult"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewCommentEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ReviewCommentEntity", "ReplyToComment") + .WithMany("Replies") + .HasForeignKey("LeagueId", "ReplyToCommentId"); + + b.HasOne("iRLeagueDatabaseCore.Models.IncidentReviewEntity", "Review") + .WithMany("Comments") + .HasForeignKey("LeagueId", "ReviewId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("ReplyToComment"); + + b.Navigation("Review"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewCommentVoteEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "MemberAtFault") + .WithMany("CommentReviewVotes") + .HasForeignKey("MemberAtFaultId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ReviewCommentEntity", "Comment") + .WithMany("ReviewCommentVotes") + .HasForeignKey("LeagueId", "CommentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "TeamAtFault") + .WithMany() + .HasForeignKey("LeagueId", "TeamAtFaultId"); + + b.HasOne("iRLeagueDatabaseCore.Models.VoteCategoryEntity", "VoteCategory") + .WithMany("CommentReviewVotes") + .HasForeignKey("LeagueId", "VoteCategoryId"); + + b.Navigation("Comment"); + + b.Navigation("MemberAtFault"); + + b.Navigation("TeamAtFault"); + + b.Navigation("VoteCategory"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewPenaltyEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "ResultRow") + .WithMany("ReviewPenalties") + .HasForeignKey("LeagueId", "ResultRowId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.IncidentReviewEntity", "Review") + .WithMany("ReviewPenaltys") + .HasForeignKey("LeagueId", "ReviewId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.AcceptedReviewVoteEntity", "ReviewVote") + .WithMany("ReviewPenaltys") + .HasForeignKey("LeagueId", "ReviewVoteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ResultRow"); + + b.Navigation("Review"); + + b.Navigation("ReviewVote"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScheduleEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.SeasonEntity", "Season") + .WithMany("Schedules") + .HasForeignKey("LeagueId", "SeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Season"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredEventResultEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.EventResultEntity", null) + .WithMany("ScoredResults") + .HasForeignKey("EventResultEntityLeagueId", "EventResultEntityEventId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ChampSeasonEntity", "ChampSeason") + .WithMany("EventResults") + .HasForeignKey("LeagueId", "ChampSeasonId"); + + b.HasOne("iRLeagueDatabaseCore.Models.EventEntity", "Event") + .WithMany("ScoredEventResults") + .HasForeignKey("LeagueId", "EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "ResultConfig") + .WithMany() + .HasForeignKey("LeagueId", "ResultConfigId"); + + b.Navigation("ChampSeason"); + + b.Navigation("Event"); + + b.Navigation("ResultConfig"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "Member") + .WithMany() + .HasForeignKey("MemberId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredSessionResultEntity", "ScoredSessionResult") + .WithMany("ScoredResultRows") + .HasForeignKey("LeagueId", "SessionResultId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "Team") + .WithMany() + .HasForeignKey("LeagueId", "TeamId"); + + b.Navigation("Member"); + + b.Navigation("ScoredSessionResult"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredSessionResultEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "FastestAvgLapDriver") + .WithMany("FastestAvgLapResults") + .HasForeignKey("FastestAvgLapDriverMemberId"); + + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "FastestLapDriver") + .WithMany("FastestLapResults") + .HasForeignKey("FastestLapDriverMemberId"); + + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "FastestQualyLapDriver") + .WithMany("FastestQualyLapResults") + .HasForeignKey("FastestQualyLapDriverMemberId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredEventResultEntity", "ScoredEventResult") + .WithMany("ScoredSessionResults") + .HasForeignKey("LeagueId", "ResultId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoringEntity", "Scoring") + .WithMany() + .HasForeignKey("LeagueId", "ScoringId"); + + b.Navigation("FastestAvgLapDriver"); + + b.Navigation("FastestLapDriver"); + + b.Navigation("FastestQualyLapDriver"); + + b.Navigation("ScoredEventResult"); + + b.Navigation("Scoring"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredTeamResultRowsResultRows", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "TeamParentRow") + .WithMany() + .HasForeignKey("LeagueId", "TeamParentRowRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "TeamResultRow") + .WithMany() + .HasForeignKey("LeagueId", "TeamResultRowRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_ScoredTeamResultRowsResultRows_ScoredResultRows_LeagueId_Te~1"); + + b.Navigation("TeamParentRow"); + + b.Navigation("TeamResultRow"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoringEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", null) + .WithMany("Scorings") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoringEntity", "ExtScoringSource") + .WithMany("DependendScorings") + .HasForeignKey("LeagueId", "ExtScoringSourceId"); + + b.HasOne("iRLeagueDatabaseCore.Models.PointRuleEntity", "PointsRule") + .WithMany("Scorings") + .HasForeignKey("LeagueId", "PointsRuleId"); + + b.HasOne("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", "ResultConfiguration") + .WithMany("Scorings") + .HasForeignKey("LeagueId", "ResultConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScheduleEntity", null) + .WithMany("Scorings") + .HasForeignKey("ScheduleEntityLeagueId", "ScheduleEntityScheduleId"); + + b.Navigation("ExtScoringSource"); + + b.Navigation("PointsRule"); + + b.Navigation("ResultConfiguration"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SeasonEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("Seasons") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoringEntity", "MainScoring") + .WithMany() + .HasForeignKey("MainScoringLeagueId", "MainScoringScoringId"); + + b.Navigation("League"); + + b.Navigation("MainScoring"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SessionEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.EventEntity", "Event") + .WithMany("Sessions") + .HasForeignKey("LeagueId", "EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SessionResultEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.EventResultEntity", "Result") + .WithMany("SessionResults") + .HasForeignKey("LeagueId", "EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.IRSimSessionDetailsEntity", "IRSimSessionDetails") + .WithMany() + .HasForeignKey("LeagueId", "IRSimSessionDetailsId"); + + b.HasOne("iRLeagueDatabaseCore.Models.SessionEntity", "Session") + .WithOne("SessionResult") + .HasForeignKey("iRLeagueDatabaseCore.Models.SessionResultEntity", "LeagueId", "SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("IRSimSessionDetails"); + + b.Navigation("Result"); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingConfigurationEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("StandingConfigs") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("League"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ChampSeasonEntity", "ChampSeason") + .WithMany("Standings") + .HasForeignKey("LeagueId", "ChampSeasonId"); + + b.HasOne("iRLeagueDatabaseCore.Models.EventEntity", "Event") + .WithMany() + .HasForeignKey("LeagueId", "EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.SeasonEntity", "Season") + .WithMany("Standings") + .HasForeignKey("LeagueId", "SeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.StandingConfigurationEntity", "StandingConfig") + .WithMany("Standings") + .HasForeignKey("LeagueId", "StandingConfigId") + .OnDelete(DeleteBehavior.ClientCascade); + + b.Navigation("ChampSeason"); + + b.Navigation("Event"); + + b.Navigation("Season"); + + b.Navigation("StandingConfig"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingRowEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "Member") + .WithMany() + .HasForeignKey("MemberId"); + + b.HasOne("iRLeagueDatabaseCore.Models.StandingEntity", "SeasonStanding") + .WithMany("StandingRows") + .HasForeignKey("LeagueId", "StandingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.TeamEntity", "Team") + .WithMany() + .HasForeignKey("LeagueId", "TeamId"); + + b.Navigation("Member"); + + b.Navigation("SeasonStanding"); + + b.Navigation("Team"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingRows_ScoredResultRows", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", "ScoredResultRow") + .WithMany("StandingRows") + .HasForeignKey("LeagueId", "ScoredResultRowRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.StandingRowEntity", "StandingRow") + .WithMany("ResultRows") + .HasForeignKey("LeagueId", "StandingRowRefId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ScoredResultRow"); + + b.Navigation("StandingRow"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StatisticSetEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", "CurrentChamp") + .WithMany("StatisticSets") + .HasForeignKey("CurrentChampId"); + + b.HasOne("iRLeagueDatabaseCore.Models.SeasonEntity", "Season") + .WithMany("StatisticSets") + .HasForeignKey("LeagueId", "SeasonId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("CurrentChamp"); + + b.Navigation("Season"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TeamEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("Teams") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("League"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TrackConfigEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.TrackGroupEntity", "TrackGroup") + .WithMany("TrackConfigs") + .HasForeignKey("TrackGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TrackGroup"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.VoteCategoryEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.LeagueEntity", "League") + .WithMany("VoteCategories") + .HasForeignKey("LeagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("League"); + }); + + modelBuilder.Entity("MemberEntityScoredSessionResultEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", null) + .WithMany() + .HasForeignKey("CleanestDriversId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredSessionResultEntity", null) + .WithMany() + .HasForeignKey("CleanestDriverResultsLeagueId", "CleanestDriverResultsSessionResultId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("MemberEntityScoredSessionResultEntity1", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.MemberEntity", null) + .WithMany() + .HasForeignKey("HardChargersId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.ScoredSessionResultEntity", null) + .WithMany() + .HasForeignKey("HardChargerResultsLeagueId", "HardChargerResultsSessionResultId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("StatisticSetEntityStatisticSetEntity", b => + { + b.HasOne("iRLeagueDatabaseCore.Models.StatisticSetEntity", null) + .WithMany() + .HasForeignKey("DependendStatisticSetsLeagueId", "DependendStatisticSetsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("iRLeagueDatabaseCore.Models.StatisticSetEntity", null) + .WithMany() + .HasForeignKey("LeagueStatisticSetsLeagueId", "LeagueStatisticSetsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.AcceptedReviewVoteEntity", b => + { + b.Navigation("ReviewPenaltys"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ChampionshipEntity", b => + { + b.Navigation("ChampSeasons"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ChampSeasonEntity", b => + { + b.Navigation("EventResults"); + + b.Navigation("Filters"); + + b.Navigation("ResultConfigurations"); + + b.Navigation("Standings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventEntity", b => + { + b.Navigation("EventResult"); + + b.Navigation("ScoredEventResults"); + + b.Navigation("Sessions"); + + b.Navigation("SimSessionDetails"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.EventResultEntity", b => + { + b.Navigation("ScoredResults"); + + b.Navigation("SessionResults"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.IncidentReviewEntity", b => + { + b.Navigation("AcceptedReviewVotes"); + + b.Navigation("Comments"); + + b.Navigation("ReviewPenaltys"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.LeagueEntity", b => + { + b.Navigation("Championships"); + + b.Navigation("LeagueMembers"); + + b.Navigation("Payments"); + + b.Navigation("PointRules"); + + b.Navigation("ResultConfigs"); + + b.Navigation("Scorings"); + + b.Navigation("Seasons"); + + b.Navigation("StandingConfigs"); + + b.Navigation("Teams"); + + b.Navigation("VoteCategories"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.MemberEntity", b => + { + b.Navigation("AcceptedReviewVotes"); + + b.Navigation("CommentReviewVotes"); + + b.Navigation("DriverStatisticRows"); + + b.Navigation("FastestAvgLapResults"); + + b.Navigation("FastestLapResults"); + + b.Navigation("FastestQualyLapResults"); + + b.Navigation("ResultRows"); + + b.Navigation("StatisticSets"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.PointRuleEntity", b => + { + b.Navigation("AutoPenalties"); + + b.Navigation("Scorings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ResultConfigurationEntity", b => + { + b.Navigation("PointFilters"); + + b.Navigation("ResultFilters"); + + b.Navigation("Scorings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ReviewCommentEntity", b => + { + b.Navigation("Replies"); + + b.Navigation("ReviewCommentVotes"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScheduleEntity", b => + { + b.Navigation("Events"); + + b.Navigation("Scorings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredEventResultEntity", b => + { + b.Navigation("ScoredSessionResults"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredResultRowEntity", b => + { + b.Navigation("AddPenalties"); + + b.Navigation("ReviewPenalties"); + + b.Navigation("StandingRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoredSessionResultEntity", b => + { + b.Navigation("ScoredResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.ScoringEntity", b => + { + b.Navigation("DependendScorings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SeasonEntity", b => + { + b.Navigation("ChampSeasons"); + + b.Navigation("Schedules"); + + b.Navigation("Standings"); + + b.Navigation("StatisticSets"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SessionEntity", b => + { + b.Navigation("IncidentReviews"); + + b.Navigation("SessionResult"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SessionResultEntity", b => + { + b.Navigation("ResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingConfigurationEntity", b => + { + b.Navigation("ChampSeasons"); + + b.Navigation("Standings"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingEntity", b => + { + b.Navigation("StandingRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StandingRowEntity", b => + { + b.Navigation("ResultRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.StatisticSetEntity", b => + { + b.Navigation("DriverStatisticRows"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.SubscriptionEntity", b => + { + b.Navigation("Payments"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TeamEntity", b => + { + b.Navigation("Members"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.TrackGroupEntity", b => + { + b.Navigation("TrackConfigs"); + }); + + modelBuilder.Entity("iRLeagueDatabaseCore.Models.VoteCategoryEntity", b => + { + b.Navigation("AcceptedReviewVotes"); + + b.Navigation("CommentReviewVotes"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/iRLeagueDatabaseCore/Migrations/20240223233643_AddPointFormula.cs b/src/iRLeagueDatabaseCore/Migrations/20240223233643_AddPointFormula.cs new file mode 100644 index 0000000..d222f34 --- /dev/null +++ b/src/iRLeagueDatabaseCore/Migrations/20240223233643_AddPointFormula.cs @@ -0,0 +1,36 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace iRLeagueDatabaseCore.Migrations +{ + public partial class AddPointFormula : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Formula", + table: "PointRules", + type: "longtext", + nullable: true); + + migrationBuilder.AddColumn( + name: "RuleType", + table: "PointRules", + type: "int", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Formula", + table: "PointRules"); + + migrationBuilder.DropColumn( + name: "RuleType", + table: "PointRules"); + } + } +} diff --git a/src/iRLeagueDatabaseCore/Migrations/LeagueDbContextModelSnapshot.cs b/src/iRLeagueDatabaseCore/Migrations/LeagueDbContextModelSnapshot.cs index 17f8447..936c850 100644 --- a/src/iRLeagueDatabaseCore/Migrations/LeagueDbContextModelSnapshot.cs +++ b/src/iRLeagueDatabaseCore/Migrations/LeagueDbContextModelSnapshot.cs @@ -1162,6 +1162,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("FinalSortOptions") .HasColumnType("longtext"); + b.Property("Formula") + .HasColumnType("longtext"); + b.Property("LastModifiedByUserId") .HasColumnType("longtext"); @@ -1186,6 +1189,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PointsSortOptions") .HasColumnType("longtext"); + b.Property("RuleType") + .HasColumnType("int"); + b.Property("Version") .HasColumnType("int"); diff --git a/src/iRLeagueDatabaseCore/Models/PointRuleEntity.cs b/src/iRLeagueDatabaseCore/Models/PointRuleEntity.cs index 327a8ec..e82b703 100644 --- a/src/iRLeagueDatabaseCore/Models/PointRuleEntity.cs +++ b/src/iRLeagueDatabaseCore/Models/PointRuleEntity.cs @@ -16,8 +16,10 @@ public PointRuleEntity() public long PointRuleId { get; set; } public string Name { get; set; } + public PointRuleType RuleType { get; set; } public ICollection PointsPerPlace { get; set; } public ICollection BonusPoints { get; set; } + public string Formula { get; set; } public int MaxPoints { get; set; } public int PointDropOff { get; set; } public ICollection PointsSortOptions { get; set; } diff --git a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj index b6cd3e2..e6aa06b 100644 --- a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj +++ b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj @@ -3,7 +3,7 @@ - + @@ -25,7 +25,7 @@ net6.0 11 iRLeagueDatabaseCore - 0.11.0 + 0.11.1 Simon Schulze Simon Schulze This package contains the Entityframework configuration for a Code first project