diff --git a/src/MysqlMigrations/Migrations/20241202131932_Patch241130.Designer.cs b/src/MysqlMigrations/Migrations/20241202131932_Patch241130.Designer.cs new file mode 100644 index 00000000..8a32b990 --- /dev/null +++ b/src/MysqlMigrations/Migrations/20241202131932_Patch241130.Designer.cs @@ -0,0 +1,2370 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using dsstats.db8; + +#nullable disable + +namespace MysqlMigrations.Migrations +{ + [DbContext(typeof(ReplayContext))] + [Migration("20241202131932_Patch241130")] + partial class Patch241130 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("DsAbilityDsUnit", b => + { + b.Property("AbilitiesDsAbilityId") + .HasColumnType("int"); + + b.Property("DsUnitsDsUnitId") + .HasColumnType("int"); + + b.HasKey("AbilitiesDsAbilityId", "DsUnitsDsUnitId"); + + b.HasIndex("DsUnitsDsUnitId"); + + b.ToTable("DsAbilityDsUnit"); + }); + + modelBuilder.Entity("ReplayUploader", b => + { + b.Property("ReplaysReplayId") + .HasColumnType("int"); + + b.Property("UploadersUploaderId") + .HasColumnType("int"); + + b.HasKey("ReplaysReplayId", "UploadersUploaderId"); + + b.HasIndex("UploadersUploaderId"); + + b.ToTable("UploaderReplays", (string)null); + }); + + modelBuilder.Entity("dsstats.db8.ArcadePlayerRating", b => + { + b.Property("ArcadePlayerRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArcadePlayerRatingId")); + + b.Property("Confidence") + .HasColumnType("double"); + + b.Property("Consistency") + .HasColumnType("double"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("IsUploader") + .HasColumnType("tinyint(1)"); + + b.Property("Main") + .HasColumnType("int"); + + b.Property("MainCount") + .HasColumnType("int"); + + b.Property("Mvp") + .HasColumnType("int"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("Pos") + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("double"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.Property("TeamGames") + .HasColumnType("int"); + + b.Property("Wins") + .HasColumnType("int"); + + b.HasKey("ArcadePlayerRatingId"); + + b.HasIndex("PlayerId"); + + b.HasIndex("RatingType"); + + b.ToTable("ArcadePlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadePlayerRatingChange", b => + { + b.Property("ArcadePlayerRatingChangeId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArcadePlayerRatingChangeId")); + + b.Property("ArcadePlayerRatingId") + .HasColumnType("int"); + + b.Property("Change10d") + .HasColumnType("float"); + + b.Property("Change24h") + .HasColumnType("float"); + + b.Property("Change30d") + .HasColumnType("float"); + + b.HasKey("ArcadePlayerRatingChangeId"); + + b.HasIndex("ArcadePlayerRatingId") + .IsUnique(); + + b.ToTable("ArcadePlayerRatingChanges"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplay", b => + { + b.Property("ArcadeReplayId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArcadeReplayId")); + + b.Property("BnetBucketId") + .HasColumnType("bigint"); + + b.Property("BnetRecordId") + .HasColumnType("bigint"); + + b.Property("CreatedAt") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("GameMode") + .HasColumnType("int"); + + b.Property("Imported") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("PlayerCount") + .HasColumnType("int"); + + b.Property("RegionId") + .HasColumnType("int"); + + b.Property("ReplayHash") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TournamentEdition") + .HasColumnType("tinyint(1)"); + + b.Property("WinnerTeam") + .HasColumnType("int"); + + b.HasKey("ArcadeReplayId"); + + b.HasIndex("ReplayHash"); + + b.HasIndex("GameMode", "CreatedAt"); + + b.HasIndex("RegionId", "BnetBucketId", "BnetRecordId") + .IsUnique(); + + b.HasIndex("RegionId", "GameMode", "CreatedAt"); + + b.ToTable("ArcadeReplays"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayDsPlayer", b => + { + b.Property("ArcadeReplayDsPlayerId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArcadeReplayDsPlayerId")); + + b.Property("ArcadeReplayId") + .HasColumnType("int"); + + b.Property("Discriminator") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("PlayerResult") + .HasColumnType("int"); + + b.Property("SlotNumber") + .HasColumnType("int"); + + b.Property("Team") + .HasColumnType("int"); + + b.HasKey("ArcadeReplayDsPlayerId"); + + b.HasIndex("ArcadeReplayId"); + + b.HasIndex("PlayerId"); + + b.ToTable("ArcadeReplayDsPlayers"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayDsPlayerRating", b => + { + b.Property("ArcadeReplayDsPlayerRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArcadeReplayDsPlayerRatingId")); + + b.Property("ArcadeReplayDsPlayerId") + .HasColumnType("int"); + + b.Property("ArcadeReplayRatingId") + .HasColumnType("int"); + + b.Property("Confidence") + .HasColumnType("float"); + + b.Property("Consistency") + .HasColumnType("float"); + + b.Property("GamePos") + .HasColumnType("int"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("float"); + + b.Property("RatingChange") + .HasColumnType("float"); + + b.HasKey("ArcadeReplayDsPlayerRatingId"); + + b.HasIndex("ArcadeReplayDsPlayerId") + .IsUnique(); + + b.HasIndex("ArcadeReplayRatingId"); + + b.ToTable("ArcadeReplayDsPlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayRating", b => + { + b.Property("ArcadeReplayRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArcadeReplayRatingId")); + + b.Property("ArcadeReplayId") + .HasColumnType("int"); + + b.Property("AvgRating") + .HasColumnType("int"); + + b.Property("ExpectationToWin") + .HasColumnType("float"); + + b.Property("LeaverType") + .HasColumnType("int"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.HasKey("ArcadeReplayRatingId"); + + b.HasIndex("ArcadeReplayId") + .IsUnique(); + + b.ToTable("ArcadeReplayRatings"); + }); + + modelBuilder.Entity("dsstats.db8.BattleNetInfo", b => + { + b.Property("BattleNetInfoId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("BattleNetInfoId")); + + b.Property("BattleNetId") + .HasColumnType("int"); + + b.Property("UploaderId") + .HasColumnType("int"); + + b.HasKey("BattleNetInfoId"); + + b.HasIndex("UploaderId"); + + b.ToTable("BattleNetInfos"); + }); + + modelBuilder.Entity("dsstats.db8.BonusDamage", b => + { + b.Property("BonusDamageId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("BonusDamageId")); + + b.Property("Damage") + .HasColumnType("int"); + + b.Property("DsWeaponId") + .HasColumnType("int"); + + b.Property("PerUpgrade") + .HasColumnType("int"); + + b.Property("UnitType") + .HasColumnType("int"); + + b.HasKey("BonusDamageId"); + + b.HasIndex("DsWeaponId"); + + b.HasIndex("UnitType"); + + b.ToTable("BonusDamages"); + }); + + modelBuilder.Entity("dsstats.db8.ComboPlayerRating", b => + { + b.Property("ComboPlayerRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ComboPlayerRatingId")); + + b.Property("Confidence") + .HasColumnType("double"); + + b.Property("Consistency") + .HasColumnType("double"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("Pos") + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("double"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.Property("Wins") + .HasColumnType("int"); + + b.HasKey("ComboPlayerRatingId"); + + b.HasIndex("PlayerId"); + + b.HasIndex("RatingType"); + + b.ToTable("ComboPlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.ComboReplayPlayerRating", b => + { + b.Property("ComboReplayPlayerRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ComboReplayPlayerRatingId")); + + b.Property("Change") + .HasPrecision(5, 2) + .HasColumnType("double"); + + b.Property("Confidence") + .HasPrecision(5, 2) + .HasColumnType("double"); + + b.Property("Consistency") + .HasPrecision(5, 2) + .HasColumnType("double"); + + b.Property("GamePos") + .HasColumnType("int"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("int"); + + b.Property("ReplayPlayerId") + .HasColumnType("int"); + + b.HasKey("ComboReplayPlayerRatingId"); + + b.HasIndex("ReplayPlayerId") + .IsUnique(); + + b.ToTable("ComboReplayPlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.ComboReplayRating", b => + { + b.Property("ComboReplayRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ComboReplayRatingId")); + + b.Property("AvgRating") + .HasColumnType("int"); + + b.Property("ExpectationToWin") + .HasPrecision(5, 2) + .HasColumnType("double"); + + b.Property("IsPreRating") + .HasColumnType("tinyint(1)"); + + b.Property("LeaverType") + .HasColumnType("int"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.Property("ReplayId") + .HasColumnType("int"); + + b.HasKey("ComboReplayRatingId"); + + b.HasIndex("RatingType"); + + b.HasIndex("ReplayId") + .IsUnique(); + + b.ToTable("ComboReplayRatings"); + }); + + modelBuilder.Entity("dsstats.db8.CommanderMmr", b => + { + b.Property("CommanderMmrId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CommanderMmrId")); + + b.Property("AntiSynergyMmr") + .HasColumnType("double"); + + b.Property("OppRace") + .HasColumnType("int"); + + b.Property("Race") + .HasColumnType("int"); + + b.Property("SynergyMmr") + .HasColumnType("double"); + + b.HasKey("CommanderMmrId"); + + b.HasIndex("Race", "OppRace"); + + b.ToTable("CommanderMmrs"); + }); + + modelBuilder.Entity("dsstats.db8.DsAbility", b => + { + b.Property("DsAbilityId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DsAbilityId")); + + b.Property("AbilityTarget") + .HasColumnType("int"); + + b.Property("AoeRadius") + .HasColumnType("float"); + + b.Property("CastRange") + .HasColumnType("int"); + + b.Property("Commander") + .HasColumnType("int"); + + b.Property("Cooldown") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(310) + .HasColumnType("varchar(310)"); + + b.Property("EnergyCost") + .HasColumnType("float"); + + b.Property("GlobalTimer") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Requirements") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("DsAbilityId"); + + b.HasIndex("Name"); + + b.ToTable("DsAbilities"); + }); + + modelBuilder.Entity("dsstats.db8.DsPickBan", b => + { + b.Property("DsPickBanId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DsPickBanId")); + + b.Property("Bans") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PickBanMode") + .HasColumnType("int"); + + b.Property("Picks") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Time") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.HasKey("DsPickBanId"); + + b.ToTable("DsPickBans"); + }); + + modelBuilder.Entity("dsstats.db8.DsUnit", b => + { + b.Property("DsUnitId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DsUnitId")); + + b.Property("Armor") + .HasColumnType("int"); + + b.Property("Color") + .HasColumnType("int"); + + b.Property("Commander") + .HasColumnType("int"); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("EnergyRegen") + .HasColumnType("float"); + + b.Property("HealthRegen") + .HasColumnType("float"); + + b.Property("Life") + .HasColumnType("int"); + + b.Property("MaxEnergy") + .HasColumnType("int"); + + b.Property("MovementType") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ShieldArmor") + .HasColumnType("int"); + + b.Property("Shields") + .HasColumnType("int"); + + b.Property("Size") + .HasColumnType("int"); + + b.Property("Speed") + .HasColumnType("float"); + + b.Property("StartingEnergy") + .HasColumnType("int"); + + b.Property("Tier") + .HasColumnType("int"); + + b.Property("UnitId") + .HasColumnType("int"); + + b.Property("UnitType") + .HasColumnType("int"); + + b.HasKey("DsUnitId"); + + b.HasIndex("Commander"); + + b.HasIndex("Name"); + + b.HasIndex("Name", "Commander"); + + b.ToTable("DsUnits"); + }); + + modelBuilder.Entity("dsstats.db8.DsUpdate", b => + { + b.Property("DsUpdateId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DsUpdateId")); + + b.Property("Change") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Commander") + .HasColumnType("int"); + + b.Property("DiscordId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Time") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.HasKey("DsUpdateId"); + + b.HasIndex("Time"); + + b.ToTable("DsUpdates"); + }); + + modelBuilder.Entity("dsstats.db8.DsUpgrade", b => + { + b.Property("DsUpgradeId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DsUpgradeId")); + + b.Property("Commander") + .HasColumnType("int"); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("DsUnitId") + .HasColumnType("int"); + + b.Property("RequiredTier") + .HasColumnType("int"); + + b.Property("Upgrade") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("DsUpgradeId"); + + b.HasIndex("DsUnitId"); + + b.HasIndex("Upgrade"); + + b.ToTable("DsUpgrades"); + }); + + modelBuilder.Entity("dsstats.db8.DsWeapon", b => + { + b.Property("DsWeaponId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DsWeaponId")); + + b.Property("AttackSpeed") + .HasColumnType("float"); + + b.Property("Attacks") + .HasColumnType("int"); + + b.Property("CanTarget") + .HasColumnType("int"); + + b.Property("Damage") + .HasColumnType("int"); + + b.Property("DamagePerUpgrade") + .HasColumnType("int"); + + b.Property("DsUnitId") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Range") + .HasColumnType("float"); + + b.HasKey("DsWeaponId"); + + b.HasIndex("DsUnitId"); + + b.ToTable("DsWeapons"); + }); + + modelBuilder.Entity("dsstats.db8.Event", b => + { + b.Property("EventId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EventId")); + + b.Property("EventGuid") + .HasColumnType("char(36)"); + + b.Property("EventStart") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("ExternalLink") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("GameMode") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("WinnerTeam") + .HasColumnType("longtext"); + + b.HasKey("EventId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Events"); + }); + + modelBuilder.Entity("dsstats.db8.Faq", b => + { + b.Property("FaqId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FaqId")); + + b.Property("Answer") + .IsRequired() + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("CreatedAt") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("CreatedBy") + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Question") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UpdatedAt") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Upvotes") + .HasColumnType("int"); + + b.HasKey("FaqId"); + + b.HasIndex("Question"); + + b.ToTable("Faqs"); + }); + + modelBuilder.Entity("dsstats.db8.FaqVote", b => + { + b.Property("FaqVoteId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FaqVoteId")); + + b.Property("FaqId") + .HasColumnType("int"); + + b.HasKey("FaqVoteId"); + + b.ToTable("FaqVotes"); + }); + + modelBuilder.Entity("dsstats.db8.FunStatsMemory", b => + { + b.Property("FunStatsMemoryId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FunStatsMemoryId")); + + b.Property("AvgGameDuration") + .HasColumnType("int"); + + b.Property("Created") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("FirstReplay") + .HasColumnType("longtext"); + + b.Property("GreatestArmyReplay") + .HasColumnType("longtext"); + + b.Property("GreatestComebackReplay") + .HasColumnType("longtext"); + + b.Property("MostCompetitiveReplay") + .HasColumnType("longtext"); + + b.Property("MostUpgradesReplay") + .HasColumnType("longtext"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.Property("TimePeriod") + .HasColumnType("int"); + + b.Property("TotalTimePlayed") + .HasColumnType("bigint"); + + b.Property("UnitCountLeast") + .HasColumnType("int"); + + b.Property("UnitCountMost") + .HasColumnType("int"); + + b.Property("UnitNameLeast") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UnitNameMost") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("FunStatsMemoryId"); + + b.ToTable("FunStatMemories"); + }); + + modelBuilder.Entity("dsstats.db8.GroupByHelper", b => + { + b.Property("Count") + .HasColumnType("int"); + + b.Property("Group") + .HasColumnType("tinyint(1)") + .HasColumnName("Name"); + + b.ToTable((string)null); + + b.ToView("GroupByHelper", (string)null); + }); + + modelBuilder.Entity("dsstats.db8.IhSession", b => + { + b.Property("IhSessionId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("IhSessionId")); + + b.Property("Closed") + .HasColumnType("tinyint(1)"); + + b.Property("Created") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("GroupId") + .HasColumnType("char(36)"); + + b.Property("GroupState") + .HasColumnType("longtext"); + + b.Property("GroupStateV2") + .HasColumnType("longtext"); + + b.Property("Players") + .HasColumnType("int"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.HasKey("IhSessionId"); + + b.HasIndex("GroupId") + .IsUnique(); + + b.ToTable("IhSessions"); + }); + + modelBuilder.Entity("dsstats.db8.IhSessionPlayer", b => + { + b.Property("IhSessionPlayerId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("IhSessionPlayerId")); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("IhSessionId") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Obs") + .HasColumnType("int"); + + b.Property("Performance") + .HasColumnType("int"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("RatingEnd") + .HasColumnType("int"); + + b.Property("RatingStart") + .HasColumnType("int"); + + b.Property("Wins") + .HasColumnType("int"); + + b.HasKey("IhSessionPlayerId"); + + b.HasIndex("IhSessionId"); + + b.HasIndex("PlayerId"); + + b.ToTable("IhSessionPlayers"); + }); + + modelBuilder.Entity("dsstats.db8.MaterializedArcadeReplay", b => + { + b.Property("MaterializedArcadeReplayId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MaterializedArcadeReplayId")); + + b.Property("ArcadeReplayId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("GameMode") + .HasColumnType("int"); + + b.Property("WinnerTeam") + .HasColumnType("int"); + + b.HasKey("MaterializedArcadeReplayId"); + + b.HasIndex("CreatedAt"); + + b.ToTable("MaterializedArcadeReplays"); + }); + + modelBuilder.Entity("dsstats.db8.NoUploadResult", b => + { + b.Property("NoUploadResultId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("NoUploadResultId")); + + b.Property("Created") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("LatestNoUpload") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("LatestReplay") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("LatestUpload") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("NoUploadDefeats") + .HasColumnType("int"); + + b.Property("NoUploadTotal") + .HasColumnType("int"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("TotalReplays") + .HasColumnType("int"); + + b.HasKey("NoUploadResultId"); + + b.HasIndex("PlayerId"); + + b.ToTable("NoUploadResults"); + }); + + modelBuilder.Entity("dsstats.db8.Player", b => + { + b.Property("PlayerId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("PlayerId")); + + b.Property("ArcadeDefeatsSinceLastUpload") + .HasColumnType("int"); + + b.Property("DisconnectCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("NotUploadCount") + .HasColumnType("int"); + + b.Property("RageQuitCount") + .HasColumnType("int"); + + b.Property("RealmId") + .HasColumnType("int"); + + b.Property("RegionId") + .HasColumnType("int"); + + b.Property("ToonId") + .HasColumnType("int"); + + b.Property("UploaderId") + .HasColumnType("int"); + + b.HasKey("PlayerId"); + + b.HasIndex("UploaderId"); + + b.HasIndex("RegionId", "RealmId", "ToonId") + .IsUnique(); + + b.ToTable("Players"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerRating", b => + { + b.Property("PlayerRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("PlayerRatingId")); + + b.Property("ArcadeDefeatsSinceLastUpload") + .HasColumnType("int"); + + b.Property("Confidence") + .HasColumnType("double"); + + b.Property("Consistency") + .HasColumnType("double"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("IsUploader") + .HasColumnType("tinyint(1)"); + + b.Property("Main") + .HasColumnType("int"); + + b.Property("MainCount") + .HasColumnType("int"); + + b.Property("Mvp") + .HasColumnType("int"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("Pos") + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("double"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.Property("TeamGames") + .HasColumnType("int"); + + b.Property("Wins") + .HasColumnType("int"); + + b.HasKey("PlayerRatingId"); + + b.HasIndex("PlayerId"); + + b.HasIndex("RatingType"); + + b.ToTable("PlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerRatingChange", b => + { + b.Property("PlayerRatingChangeId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("PlayerRatingChangeId")); + + b.Property("Change10d") + .HasColumnType("float"); + + b.Property("Change24h") + .HasColumnType("float"); + + b.Property("Change30d") + .HasColumnType("float"); + + b.Property("PlayerRatingId") + .HasColumnType("int"); + + b.HasKey("PlayerRatingChangeId"); + + b.HasIndex("PlayerRatingId") + .IsUnique(); + + b.ToTable("PlayerRatingChanges"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerUpgrade", b => + { + b.Property("PlayerUpgradeId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("PlayerUpgradeId")); + + b.Property("Gameloop") + .HasColumnType("int"); + + b.Property("ReplayPlayerId") + .HasColumnType("int"); + + b.Property("UpgradeId") + .HasColumnType("int"); + + b.HasKey("PlayerUpgradeId"); + + b.HasIndex("ReplayPlayerId"); + + b.HasIndex("UpgradeId"); + + b.ToTable("PlayerUpgrades"); + }); + + modelBuilder.Entity("dsstats.db8.RepPlayerRating", b => + { + b.Property("RepPlayerRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("RepPlayerRatingId")); + + b.Property("Confidence") + .HasColumnType("float"); + + b.Property("Consistency") + .HasColumnType("float"); + + b.Property("GamePos") + .HasColumnType("int"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("Rating") + .HasColumnType("float"); + + b.Property("RatingChange") + .HasColumnType("float"); + + b.Property("ReplayPlayerId") + .HasColumnType("int"); + + b.Property("ReplayRatingInfoId") + .HasColumnType("int"); + + b.HasKey("RepPlayerRatingId"); + + b.HasIndex("ReplayPlayerId") + .IsUnique(); + + b.HasIndex("ReplayRatingInfoId"); + + b.ToTable("RepPlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.Replay", b => + { + b.Property("ReplayId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayId")); + + b.Property("Bunker") + .HasColumnType("int"); + + b.Property("Cannon") + .HasColumnType("int"); + + b.Property("CommandersTeam1") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CommandersTeam2") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("DefaultFilter") + .HasColumnType("tinyint(1)"); + + b.Property("Downloads") + .HasColumnType("int"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("GameMode") + .HasColumnType("int"); + + b.Property("GameTime") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Imported") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Maxkillsum") + .HasColumnType("int"); + + b.Property("Maxleaver") + .HasColumnType("int"); + + b.Property("Middle") + .IsRequired() + .HasMaxLength(4000) + .HasColumnType("varchar(4000)"); + + b.Property("Minarmy") + .HasColumnType("int"); + + b.Property("Minincome") + .HasColumnType("int"); + + b.Property("Minkillsum") + .HasColumnType("int"); + + b.Property("Objective") + .HasColumnType("int"); + + b.Property("PlayerPos") + .HasColumnType("int"); + + b.Property("PlayerResult") + .HasColumnType("int"); + + b.Property("Playercount") + .HasColumnType("tinyint unsigned"); + + b.Property("ReplayEventId") + .HasColumnType("int"); + + b.Property("ReplayHash") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("char(64)") + .IsFixedLength(); + + b.Property("ResultCorrected") + .HasColumnType("tinyint(1)"); + + b.Property("TournamentEdition") + .HasColumnType("tinyint(1)"); + + b.Property("Uploaded") + .HasColumnType("tinyint(1)"); + + b.Property("Views") + .HasColumnType("int"); + + b.Property("WinnerTeam") + .HasColumnType("int"); + + b.HasKey("ReplayId"); + + b.HasIndex("FileName"); + + b.HasIndex("GameTime"); + + b.HasIndex("Imported"); + + b.HasIndex("Maxkillsum"); + + b.HasIndex("ReplayEventId"); + + b.HasIndex("ReplayHash") + .IsUnique(); + + b.HasIndex("GameTime", "GameMode"); + + b.HasIndex("GameTime", "GameMode", "DefaultFilter"); + + b.HasIndex("GameTime", "GameMode", "Maxleaver"); + + b.HasIndex("GameTime", "GameMode", "WinnerTeam"); + + b.ToTable("Replays"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayArcadeMatch", b => + { + b.Property("ReplayArcadeMatchId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayArcadeMatchId")); + + b.Property("ArcadeReplayId") + .HasColumnType("int"); + + b.Property("MatchTime") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("ReplayId") + .HasColumnType("int"); + + b.HasKey("ReplayArcadeMatchId"); + + b.HasIndex("ArcadeReplayId") + .IsUnique(); + + b.HasIndex("MatchTime"); + + b.HasIndex("ReplayId") + .IsUnique(); + + b.ToTable("ReplayArcadeMatches"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayDownloadCount", b => + { + b.Property("ReplayDownloadCountId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayDownloadCountId")); + + b.Property("ReplayHash") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("ReplayDownloadCountId"); + + b.ToTable("ReplayDownloadCounts"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayEvent", b => + { + b.Property("ReplayEventId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayEventId")); + + b.Property("Ban1") + .HasColumnType("int"); + + b.Property("Ban2") + .HasColumnType("int"); + + b.Property("Ban3") + .HasColumnType("int"); + + b.Property("Ban4") + .HasColumnType("int"); + + b.Property("Ban5") + .HasColumnType("int"); + + b.Property("EventId") + .HasColumnType("int"); + + b.Property("Round") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RunnerTeam") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("WinnerTeam") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("ReplayEventId"); + + b.HasIndex("EventId"); + + b.ToTable("ReplayEvents"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayPlayer", b => + { + b.Property("ReplayPlayerId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayPlayerId")); + + b.Property("APM") + .HasColumnType("int"); + + b.Property("Army") + .HasColumnType("int"); + + b.Property("Clan") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("DidNotUpload") + .HasColumnType("tinyint(1)"); + + b.Property("Downloads") + .HasColumnType("int"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("GamePos") + .HasColumnType("int"); + + b.Property("Income") + .HasColumnType("int"); + + b.Property("IsLeaver") + .HasColumnType("tinyint(1)"); + + b.Property("IsUploader") + .HasColumnType("tinyint(1)"); + + b.Property("Kills") + .HasColumnType("int"); + + b.Property("LastSpawnHash") + .HasMaxLength(64) + .HasColumnType("char(64)") + .IsFixedLength(); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("OppRace") + .HasColumnType("int"); + + b.Property("PlayerId") + .HasColumnType("int"); + + b.Property("PlayerResult") + .HasColumnType("int"); + + b.Property("Race") + .HasColumnType("int"); + + b.Property("Refineries") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("ReplayId") + .HasColumnType("int"); + + b.Property("Team") + .HasColumnType("int"); + + b.Property("TierUpgrades") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("UpgradeId") + .HasColumnType("int"); + + b.Property("UpgradesSpent") + .HasColumnType("int"); + + b.Property("Views") + .HasColumnType("int"); + + b.HasKey("ReplayPlayerId"); + + b.HasIndex("Kills"); + + b.HasIndex("LastSpawnHash") + .IsUnique(); + + b.HasIndex("Name"); + + b.HasIndex("PlayerId"); + + b.HasIndex("Race"); + + b.HasIndex("ReplayId"); + + b.HasIndex("UpgradeId"); + + b.HasIndex("IsUploader", "Team"); + + b.HasIndex("Race", "OppRace"); + + b.ToTable("ReplayPlayers"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayRating", b => + { + b.Property("ReplayRatingId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayRatingId")); + + b.Property("AvgRating") + .HasColumnType("int"); + + b.Property("ExpectationToWin") + .HasColumnType("float"); + + b.Property("IsPreRating") + .HasColumnType("tinyint(1)"); + + b.Property("LeaverType") + .HasColumnType("int"); + + b.Property("RatingType") + .HasColumnType("int"); + + b.Property("ReplayId") + .HasColumnType("int"); + + b.HasKey("ReplayRatingId"); + + b.HasIndex("RatingType"); + + b.HasIndex("ReplayId") + .IsUnique(); + + b.ToTable("ReplayRatings"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayViewCount", b => + { + b.Property("ReplayViewCountId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReplayViewCountId")); + + b.Property("ReplayHash") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("ReplayViewCountId"); + + b.ToTable("ReplayViewCounts"); + }); + + modelBuilder.Entity("dsstats.db8.SkipReplay", b => + { + b.Property("SkipReplayId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SkipReplayId")); + + b.Property("Path") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.HasKey("SkipReplayId"); + + b.ToTable("SkipReplays"); + }); + + modelBuilder.Entity("dsstats.db8.Spawn", b => + { + b.Property("SpawnId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SpawnId")); + + b.Property("ArmyValue") + .HasColumnType("int"); + + b.Property("Breakpoint") + .HasColumnType("int"); + + b.Property("Gameloop") + .HasColumnType("int"); + + b.Property("GasCount") + .HasColumnType("int"); + + b.Property("Income") + .HasColumnType("int"); + + b.Property("KilledValue") + .HasColumnType("int"); + + b.Property("ReplayPlayerId") + .HasColumnType("int"); + + b.Property("UpgradeSpent") + .HasColumnType("int"); + + b.HasKey("SpawnId"); + + b.HasIndex("ReplayPlayerId"); + + b.ToTable("Spawns"); + }); + + modelBuilder.Entity("dsstats.db8.SpawnUnit", b => + { + b.Property("SpawnUnitId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SpawnUnitId")); + + b.Property("Count") + .HasColumnType("tinyint unsigned"); + + b.Property("Poss") + .IsRequired() + .HasMaxLength(4000) + .HasColumnType("varchar(4000)"); + + b.Property("SpawnId") + .HasColumnType("int"); + + b.Property("UnitId") + .HasColumnType("int"); + + b.HasKey("SpawnUnitId"); + + b.HasIndex("SpawnId"); + + b.HasIndex("UnitId"); + + b.ToTable("SpawnUnits"); + }); + + modelBuilder.Entity("dsstats.db8.StreakInfo", b => + { + b.Property("LongestStreak") + .HasColumnType("double"); + + b.Property("PlayerResult") + .HasColumnType("int"); + + b.ToTable("StreakInfos"); + }); + + modelBuilder.Entity("dsstats.db8.Unit", b => + { + b.Property("UnitId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("UnitId")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("UnitId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Units"); + }); + + modelBuilder.Entity("dsstats.db8.Upgrade", b => + { + b.Property("UpgradeId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("UpgradeId")); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("UpgradeId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Upgrades"); + }); + + modelBuilder.Entity("dsstats.db8.Uploader", b => + { + b.Property("UploaderId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("UploaderId")); + + b.Property("AppGuid") + .HasColumnType("char(36)"); + + b.Property("AppVersion") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Games") + .HasColumnType("int"); + + b.Property("Identifier") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LatestReplay") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("LatestUpload") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("MainCommander") + .HasColumnType("int"); + + b.Property("MainCount") + .HasColumnType("int"); + + b.Property("Mvp") + .HasColumnType("int"); + + b.Property("TeamGames") + .HasColumnType("int"); + + b.Property("UploadDisabledCount") + .HasColumnType("int"); + + b.Property("UploadIsDisabled") + .HasColumnType("tinyint(1)"); + + b.Property("UploadLastDisabled") + .HasPrecision(0) + .HasColumnType("datetime(0)"); + + b.Property("Wins") + .HasColumnType("int"); + + b.HasKey("UploaderId"); + + b.HasIndex("AppGuid") + .IsUnique(); + + b.ToTable("Uploaders"); + }); + + modelBuilder.Entity("DsAbilityDsUnit", b => + { + b.HasOne("dsstats.db8.DsAbility", null) + .WithMany() + .HasForeignKey("AbilitiesDsAbilityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.DsUnit", null) + .WithMany() + .HasForeignKey("DsUnitsDsUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReplayUploader", b => + { + b.HasOne("dsstats.db8.Replay", null) + .WithMany() + .HasForeignKey("ReplaysReplayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Uploader", null) + .WithMany() + .HasForeignKey("UploadersUploaderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("dsstats.db8.ArcadePlayerRating", b => + { + b.HasOne("dsstats.db8.Player", "Player") + .WithMany("ArcadePlayerRatings") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadePlayerRatingChange", b => + { + b.HasOne("dsstats.db8.ArcadePlayerRating", "ArcadePlayerRating") + .WithOne("ArcadePlayerRatingChange") + .HasForeignKey("dsstats.db8.ArcadePlayerRatingChange", "ArcadePlayerRatingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ArcadePlayerRating"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayDsPlayer", b => + { + b.HasOne("dsstats.db8.ArcadeReplay", "ArcadeReplay") + .WithMany("ArcadeReplayDsPlayers") + .HasForeignKey("ArcadeReplayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Player", "Player") + .WithMany() + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ArcadeReplay"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayDsPlayerRating", b => + { + b.HasOne("dsstats.db8.ArcadeReplayDsPlayer", "ReplayDsPlayer") + .WithOne("ArcadeReplayPlayerRating") + .HasForeignKey("dsstats.db8.ArcadeReplayDsPlayerRating", "ArcadeReplayDsPlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.ArcadeReplayRating", "ArcadeReplayRating") + .WithMany("ArcadeReplayDsPlayerRatings") + .HasForeignKey("ArcadeReplayRatingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ArcadeReplayRating"); + + b.Navigation("ReplayDsPlayer"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayRating", b => + { + b.HasOne("dsstats.db8.ArcadeReplay", "ArcadeReplay") + .WithOne("ArcadeReplayRating") + .HasForeignKey("dsstats.db8.ArcadeReplayRating", "ArcadeReplayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ArcadeReplay"); + }); + + modelBuilder.Entity("dsstats.db8.BattleNetInfo", b => + { + b.HasOne("dsstats.db8.Uploader", "Uploader") + .WithMany("BattleNetInfos") + .HasForeignKey("UploaderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Uploader"); + }); + + modelBuilder.Entity("dsstats.db8.BonusDamage", b => + { + b.HasOne("dsstats.db8.DsWeapon", "DsWeapon") + .WithMany("BonusDamages") + .HasForeignKey("DsWeaponId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DsWeapon"); + }); + + modelBuilder.Entity("dsstats.db8.ComboPlayerRating", b => + { + b.HasOne("dsstats.db8.Player", "Player") + .WithMany() + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("dsstats.db8.ComboReplayPlayerRating", b => + { + b.HasOne("dsstats.db8.ReplayPlayer", "ReplayPlayer") + .WithOne("ComboReplayPlayerRating") + .HasForeignKey("dsstats.db8.ComboReplayPlayerRating", "ReplayPlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReplayPlayer"); + }); + + modelBuilder.Entity("dsstats.db8.ComboReplayRating", b => + { + b.HasOne("dsstats.db8.Replay", "Replay") + .WithOne("ComboReplayRating") + .HasForeignKey("dsstats.db8.ComboReplayRating", "ReplayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Replay"); + }); + + modelBuilder.Entity("dsstats.db8.DsUpgrade", b => + { + b.HasOne("dsstats.db8.DsUnit", null) + .WithMany("Upgrades") + .HasForeignKey("DsUnitId"); + }); + + modelBuilder.Entity("dsstats.db8.DsWeapon", b => + { + b.HasOne("dsstats.db8.DsUnit", "DsUnit") + .WithMany("Weapons") + .HasForeignKey("DsUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DsUnit"); + }); + + modelBuilder.Entity("dsstats.db8.IhSessionPlayer", b => + { + b.HasOne("dsstats.db8.IhSession", "IhSession") + .WithMany("IhSessionPlayers") + .HasForeignKey("IhSessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Player", "Player") + .WithMany() + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("IhSession"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("dsstats.db8.NoUploadResult", b => + { + b.HasOne("dsstats.db8.Player", "Player") + .WithMany() + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("dsstats.db8.Player", b => + { + b.HasOne("dsstats.db8.Uploader", "Uploader") + .WithMany("Players") + .HasForeignKey("UploaderId"); + + b.Navigation("Uploader"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerRating", b => + { + b.HasOne("dsstats.db8.Player", "Player") + .WithMany("PlayerRatings") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerRatingChange", b => + { + b.HasOne("dsstats.db8.PlayerRating", "PlayerRating") + .WithOne("PlayerRatingChange") + .HasForeignKey("dsstats.db8.PlayerRatingChange", "PlayerRatingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PlayerRating"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerUpgrade", b => + { + b.HasOne("dsstats.db8.ReplayPlayer", "ReplayPlayer") + .WithMany("Upgrades") + .HasForeignKey("ReplayPlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Upgrade", "Upgrade") + .WithMany() + .HasForeignKey("UpgradeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReplayPlayer"); + + b.Navigation("Upgrade"); + }); + + modelBuilder.Entity("dsstats.db8.RepPlayerRating", b => + { + b.HasOne("dsstats.db8.ReplayPlayer", "ReplayPlayer") + .WithOne("ReplayPlayerRatingInfo") + .HasForeignKey("dsstats.db8.RepPlayerRating", "ReplayPlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.ReplayRating", "ReplayRatingInfo") + .WithMany("RepPlayerRatings") + .HasForeignKey("ReplayRatingInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReplayPlayer"); + + b.Navigation("ReplayRatingInfo"); + }); + + modelBuilder.Entity("dsstats.db8.Replay", b => + { + b.HasOne("dsstats.db8.ReplayEvent", "ReplayEvent") + .WithMany("Replays") + .HasForeignKey("ReplayEventId"); + + b.Navigation("ReplayEvent"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayEvent", b => + { + b.HasOne("dsstats.db8.Event", "Event") + .WithMany("ReplayEvents") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayPlayer", b => + { + b.HasOne("dsstats.db8.Player", "Player") + .WithMany("ReplayPlayers") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Replay", "Replay") + .WithMany("ReplayPlayers") + .HasForeignKey("ReplayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Upgrade", null) + .WithMany("ReplayPlayers") + .HasForeignKey("UpgradeId"); + + b.Navigation("Player"); + + b.Navigation("Replay"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayRating", b => + { + b.HasOne("dsstats.db8.Replay", "Replay") + .WithOne("ReplayRatingInfo") + .HasForeignKey("dsstats.db8.ReplayRating", "ReplayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Replay"); + }); + + modelBuilder.Entity("dsstats.db8.Spawn", b => + { + b.HasOne("dsstats.db8.ReplayPlayer", "ReplayPlayer") + .WithMany("Spawns") + .HasForeignKey("ReplayPlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReplayPlayer"); + }); + + modelBuilder.Entity("dsstats.db8.SpawnUnit", b => + { + b.HasOne("dsstats.db8.Spawn", "Spawn") + .WithMany("Units") + .HasForeignKey("SpawnId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("dsstats.db8.Unit", "Unit") + .WithMany() + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Spawn"); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadePlayerRating", b => + { + b.Navigation("ArcadePlayerRatingChange"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplay", b => + { + b.Navigation("ArcadeReplayDsPlayers"); + + b.Navigation("ArcadeReplayRating"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayDsPlayer", b => + { + b.Navigation("ArcadeReplayPlayerRating"); + }); + + modelBuilder.Entity("dsstats.db8.ArcadeReplayRating", b => + { + b.Navigation("ArcadeReplayDsPlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.DsUnit", b => + { + b.Navigation("Upgrades"); + + b.Navigation("Weapons"); + }); + + modelBuilder.Entity("dsstats.db8.DsWeapon", b => + { + b.Navigation("BonusDamages"); + }); + + modelBuilder.Entity("dsstats.db8.Event", b => + { + b.Navigation("ReplayEvents"); + }); + + modelBuilder.Entity("dsstats.db8.IhSession", b => + { + b.Navigation("IhSessionPlayers"); + }); + + modelBuilder.Entity("dsstats.db8.Player", b => + { + b.Navigation("ArcadePlayerRatings"); + + b.Navigation("PlayerRatings"); + + b.Navigation("ReplayPlayers"); + }); + + modelBuilder.Entity("dsstats.db8.PlayerRating", b => + { + b.Navigation("PlayerRatingChange"); + }); + + modelBuilder.Entity("dsstats.db8.Replay", b => + { + b.Navigation("ComboReplayRating"); + + b.Navigation("ReplayPlayers"); + + b.Navigation("ReplayRatingInfo"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayEvent", b => + { + b.Navigation("Replays"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayPlayer", b => + { + b.Navigation("ComboReplayPlayerRating"); + + b.Navigation("ReplayPlayerRatingInfo"); + + b.Navigation("Spawns"); + + b.Navigation("Upgrades"); + }); + + modelBuilder.Entity("dsstats.db8.ReplayRating", b => + { + b.Navigation("RepPlayerRatings"); + }); + + modelBuilder.Entity("dsstats.db8.Spawn", b => + { + b.Navigation("Units"); + }); + + modelBuilder.Entity("dsstats.db8.Upgrade", b => + { + b.Navigation("ReplayPlayers"); + }); + + modelBuilder.Entity("dsstats.db8.Uploader", b => + { + b.Navigation("BattleNetInfos"); + + b.Navigation("Players"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/MysqlMigrations/Migrations/20241202131932_Patch241130.cs b/src/MysqlMigrations/Migrations/20241202131932_Patch241130.cs new file mode 100644 index 00000000..e660c49c --- /dev/null +++ b/src/MysqlMigrations/Migrations/20241202131932_Patch241130.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MysqlMigrations.Migrations +{ + /// + public partial class Patch241130 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + var sql1 = @"INSERT INTO DsUpdates (`Commander`, `Time`, `DiscordId`, `Change`) VALUES +(1, '2024-11-30', 0, '- Stalker cost increased from 110 to 115'), +(1, '2024-11-30', 0, '- Archon/High Templar cost reduced from 275 to 265'), +(1, '2024-11-30', 0, '- Immortal cost reduced from 255 to 245'), +(1, '2024-11-30', 0, '- Phoenix cost reduced from 140 to 135'), +(1, '2024-11-30', 0, '- Void ray cost reduced from 250 to 240'), +(1, '2024-11-30', 0, '- Tempest cost reduced from 335 to 325'), +(2, '2024-11-30', 0, '- Ghost cost reduced from 235 to 230'), +(2, '2024-11-30', 0, '- Siege Tank cost reduced from 265 to 260'), +(3, '2024-11-30', 0, '- Hydralisk cost increased from 95 to 100'), +(3, '2024-11-30', 0, '- Added Lunge.'); +"; + migrationBuilder.Sql(sql1); + + var sql2 = @"UPDATE DsUnits SET Cost = 125 WHERE Commander = 1 and Name = 'Stalker'; +UPDATE DsUnits SET Cost = 265 WHERE Commander = 1 and Name = 'High Templar'; +UPDATE DsUnits SET Cost = 265 WHERE Commander = 1 and Name = 'Archon'; +UPDATE DsUnits SET Cost = 245 WHERE Commander = 1 and Name = 'Immortal'; +UPDATE DsUnits SET Cost = 135 WHERE Commander = 1 and Name = 'Phoenix'; +UPDATE DsUnits SET Cost = 240 WHERE Commander = 1 and Name = 'Void Ray'; +UPDATE DsUnits SET Cost = 325 WHERE Commander = 1 and Name = 'Tempest'; +UPDATE DsUnits SET Cost = 230 WHERE Commander = 2 and Name = 'Ghost'; +UPDATE DsUnits SET Cost = 260 WHERE Commander = 2 and Name = 'Siege Tank'; +UPDATE DsUnits SET Cost = 100 WHERE Commander = 3 and Name = 'Hydralisk'; + +"; + migrationBuilder.Sql(sql2); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/src/MysqlMigrations/Migrations/ReplayContextModelSnapshot.cs b/src/MysqlMigrations/Migrations/ReplayContextModelSnapshot.cs index 89c16acc..8f91027a 100644 --- a/src/MysqlMigrations/Migrations/ReplayContextModelSnapshot.cs +++ b/src/MysqlMigrations/Migrations/ReplayContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);