Stats
This commit is contained in:
@@ -0,0 +1,658 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Server.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SystemRevivalServer.Migrations
|
||||
{
|
||||
[DbContext(typeof(GameDbContext))]
|
||||
[Migration("20251204134242_AddVoidScavengersStats")]
|
||||
partial class AddVoidScavengersStats
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.10")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Server.Data.Account", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<DateTime?>("BannedUntil")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<bool>("IsBanned")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<byte[]>("PasswordHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("varbinary(64)");
|
||||
|
||||
b.Property<byte[]>("PasswordSalt")
|
||||
.IsRequired()
|
||||
.HasColumnType("varbinary(32)");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.Property<string>("Username")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("varchar(32)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Email")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("Username")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("accounts", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Character", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("AccountId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<string>("AppearanceJson")
|
||||
.HasColumnType("json");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<float>("FacingDeg")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<uint>("HpCurrent")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("HpMax")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("Level")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("MpCurrent")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("MpMax")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("varchar(32)");
|
||||
|
||||
b.Property<double>("PosX")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PosY")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PosZ")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<uint>("StaminaCurrent")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("StaminaMax")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("StatDexterity")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("StatEndurance")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("StatIntelligence")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("StatStrength")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("StatWisdom")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.Property<ulong>("Xp")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<ulong>("ZoneId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("ZoneId");
|
||||
|
||||
b.ToTable("characters", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.EquipmentSlot", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("CharacterId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<ulong>("ItemTemplateId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<byte>("SlotCode")
|
||||
.HasColumnType("tinyint unsigned");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ItemTemplateId");
|
||||
|
||||
b.HasIndex("CharacterId", "SlotCode")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("equipment", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.InventoryItem", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("CharacterId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<ulong>("ItemTemplateId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<uint>("Quantity")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<uint>("SlotIndex")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CharacterId");
|
||||
|
||||
b.HasIndex("ItemTemplateId");
|
||||
|
||||
b.HasIndex("CharacterId", "SlotIndex")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("inventories", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.ItemTemplate", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<byte>("ItemType")
|
||||
.HasColumnType("tinyint unsigned");
|
||||
|
||||
b.Property<uint>("MaxStack")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)");
|
||||
|
||||
b.Property<byte>("Rarity")
|
||||
.HasColumnType("tinyint unsigned");
|
||||
|
||||
b.Property<string>("StatsJson")
|
||||
.HasColumnType("json");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.Property<uint>("Weight")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("item_templates", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.MatchHistory", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("AccountId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<int>("DamageDealt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DamageTaken")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Deaths")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("EloAfter")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("EloChange")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("EnergyCollected")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ItemsCrafted")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Kills")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MatchDurationSeconds")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MatchId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("varchar(32)");
|
||||
|
||||
b.Property<int>("Placement")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("PlayedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<int>("RareCollected")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Result")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ScrapCollected")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SurvivalTimeSeconds")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TotalPlayers")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.HasIndex("MatchId");
|
||||
|
||||
b.HasIndex("PlayedAt");
|
||||
|
||||
b.ToTable("match_history", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.PlayerStats", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("AccountId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<int>("Deaths")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Elo")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasDefaultValue(1000);
|
||||
|
||||
b.Property<int>("Extractions")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ItemsCrafted")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Kills")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LongestSurvivalSeconds")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Losses")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MatchesPlayed")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("TotalDamageDealt")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalDamageTaken")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalEnergyCollected")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalPlayTimeSeconds")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalRareCollected")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalScrapCollected")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.Property<int>("Wins")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("player_stats", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Session", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("AccountId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<string>("CreatedIp")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)");
|
||||
|
||||
b.Property<DateTime>("ExpiresAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime?>("RevokedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TokenHash")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("UserAgent")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.HasIndex("TokenHash")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("sessions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Zone", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<double>("MaxX")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("MaxY")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("MaxZ")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("MinX")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("MinY")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("MinZ")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("zones", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Character", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
.WithMany("Characters")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Server.Data.Zone", "Zone")
|
||||
.WithMany()
|
||||
.HasForeignKey("ZoneId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
|
||||
b.Navigation("Zone");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.EquipmentSlot", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Character", "Character")
|
||||
.WithMany()
|
||||
.HasForeignKey("CharacterId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Server.Data.ItemTemplate", "ItemTemplate")
|
||||
.WithMany()
|
||||
.HasForeignKey("ItemTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Character");
|
||||
|
||||
b.Navigation("ItemTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.InventoryItem", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Character", "Character")
|
||||
.WithMany()
|
||||
.HasForeignKey("CharacterId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Server.Data.ItemTemplate", "ItemTemplate")
|
||||
.WithMany()
|
||||
.HasForeignKey("ItemTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Character");
|
||||
|
||||
b.Navigation("ItemTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.MatchHistory", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.PlayerStats", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
.WithOne()
|
||||
.HasForeignKey("Server.Data.PlayerStats", "AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Session", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
.WithMany("Sessions")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Account", b =>
|
||||
{
|
||||
b.Navigation("Characters");
|
||||
|
||||
b.Navigation("Sessions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SystemRevivalServer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddVoidScavengersStats : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "match_history",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<ulong>(type: "bigint unsigned", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
MatchId = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
AccountId = table.Column<ulong>(type: "bigint unsigned", nullable: false),
|
||||
Result = table.Column<int>(type: "int", nullable: false),
|
||||
Placement = table.Column<int>(type: "int", nullable: false),
|
||||
TotalPlayers = table.Column<int>(type: "int", nullable: false),
|
||||
Kills = table.Column<int>(type: "int", nullable: false),
|
||||
Deaths = table.Column<int>(type: "int", nullable: false),
|
||||
DamageDealt = table.Column<int>(type: "int", nullable: false),
|
||||
DamageTaken = table.Column<int>(type: "int", nullable: false),
|
||||
ScrapCollected = table.Column<int>(type: "int", nullable: false),
|
||||
EnergyCollected = table.Column<int>(type: "int", nullable: false),
|
||||
RareCollected = table.Column<int>(type: "int", nullable: false),
|
||||
ItemsCrafted = table.Column<int>(type: "int", nullable: false),
|
||||
SurvivalTimeSeconds = table.Column<int>(type: "int", nullable: false),
|
||||
MatchDurationSeconds = table.Column<int>(type: "int", nullable: false),
|
||||
EloChange = table.Column<int>(type: "int", nullable: false),
|
||||
EloAfter = table.Column<int>(type: "int", nullable: false),
|
||||
PlayedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_match_history", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_match_history_accounts_AccountId",
|
||||
column: x => x.AccountId,
|
||||
principalTable: "accounts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "player_stats",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<ulong>(type: "bigint unsigned", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
AccountId = table.Column<ulong>(type: "bigint unsigned", nullable: false),
|
||||
MatchesPlayed = table.Column<int>(type: "int", nullable: false),
|
||||
Wins = table.Column<int>(type: "int", nullable: false),
|
||||
Losses = table.Column<int>(type: "int", nullable: false),
|
||||
Extractions = table.Column<int>(type: "int", nullable: false),
|
||||
Kills = table.Column<int>(type: "int", nullable: false),
|
||||
Deaths = table.Column<int>(type: "int", nullable: false),
|
||||
TotalDamageDealt = table.Column<long>(type: "bigint", nullable: false),
|
||||
TotalDamageTaken = table.Column<long>(type: "bigint", nullable: false),
|
||||
TotalScrapCollected = table.Column<long>(type: "bigint", nullable: false),
|
||||
TotalEnergyCollected = table.Column<long>(type: "bigint", nullable: false),
|
||||
TotalRareCollected = table.Column<long>(type: "bigint", nullable: false),
|
||||
ItemsCrafted = table.Column<int>(type: "int", nullable: false),
|
||||
TotalPlayTimeSeconds = table.Column<long>(type: "bigint", nullable: false),
|
||||
LongestSurvivalSeconds = table.Column<int>(type: "int", nullable: false),
|
||||
Elo = table.Column<int>(type: "int", nullable: false, defaultValue: 1000),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_player_stats", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_player_stats_accounts_AccountId",
|
||||
column: x => x.AccountId,
|
||||
principalTable: "accounts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_match_history_AccountId",
|
||||
table: "match_history",
|
||||
column: "AccountId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_match_history_MatchId",
|
||||
table: "match_history",
|
||||
column: "MatchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_match_history_PlayedAt",
|
||||
table: "match_history",
|
||||
column: "PlayedAt");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_player_stats_AccountId",
|
||||
table: "player_stats",
|
||||
column: "AccountId",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "match_history");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "player_stats");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,6 +302,161 @@ namespace SystemRevivalServer.Migrations
|
||||
b.ToTable("item_templates", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.MatchHistory", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("AccountId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<int>("DamageDealt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DamageTaken")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Deaths")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("EloAfter")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("EloChange")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("EnergyCollected")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ItemsCrafted")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Kills")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MatchDurationSeconds")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MatchId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("varchar(32)");
|
||||
|
||||
b.Property<int>("Placement")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("PlayedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<int>("RareCollected")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Result")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ScrapCollected")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SurvivalTimeSeconds")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TotalPlayers")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.HasIndex("MatchId");
|
||||
|
||||
b.HasIndex("PlayedAt");
|
||||
|
||||
b.ToTable("match_history", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.PlayerStats", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<ulong>("Id"));
|
||||
|
||||
b.Property<ulong>("AccountId")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
b.Property<int>("Deaths")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Elo")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasDefaultValue(1000);
|
||||
|
||||
b.Property<int>("Extractions")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ItemsCrafted")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Kills")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LongestSurvivalSeconds")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Losses")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MatchesPlayed")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("TotalDamageDealt")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalDamageTaken")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalEnergyCollected")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalPlayTimeSeconds")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalRareCollected")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("TotalScrapCollected")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));
|
||||
|
||||
b.Property<int>("Wins")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("player_stats", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Session", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
@@ -455,6 +610,28 @@ namespace SystemRevivalServer.Migrations
|
||||
b.Navigation("ItemTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.MatchHistory", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.PlayerStats", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
.WithOne()
|
||||
.HasForeignKey("Server.Data.PlayerStats", "AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Session", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Account", "Account")
|
||||
|
||||
Reference in New Issue
Block a user