//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Server.Data;
#nullable disable
namespace SystemRevivalServer.Migrations
{
[DbContext(typeof(GameDbContext))]
partial class GameDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("BannedUntil")
.HasColumnType("datetime(6)");
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("Email")
.HasMaxLength(255)
.HasColumnType("varchar(255)");
b.Property("IsBanned")
.HasColumnType("tinyint(1)");
b.Property("PasswordHash")
.IsRequired()
.HasColumnType("varbinary(64)");
b.Property("PasswordSalt")
.IsRequired()
.HasColumnType("varbinary(32)");
b.Property("UpdatedAt")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt"));
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("AccountId")
.HasColumnType("bigint unsigned");
b.Property("AppearanceJson")
.HasColumnType("json");
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("FacingDeg")
.HasColumnType("float");
b.Property("HpCurrent")
.HasColumnType("int unsigned");
b.Property("HpMax")
.HasColumnType("int unsigned");
b.Property("Level")
.HasColumnType("int unsigned");
b.Property("MpCurrent")
.HasColumnType("int unsigned");
b.Property("MpMax")
.HasColumnType("int unsigned");
b.Property("Name")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("varchar(32)");
b.Property("PosX")
.HasColumnType("double");
b.Property("PosY")
.HasColumnType("double");
b.Property("PosZ")
.HasColumnType("double");
b.Property("StaminaCurrent")
.HasColumnType("int unsigned");
b.Property("StaminaMax")
.HasColumnType("int unsigned");
b.Property("StatDexterity")
.HasColumnType("int unsigned");
b.Property("StatEndurance")
.HasColumnType("int unsigned");
b.Property("StatIntelligence")
.HasColumnType("int unsigned");
b.Property("StatStrength")
.HasColumnType("int unsigned");
b.Property("StatWisdom")
.HasColumnType("int unsigned");
b.Property("UpdatedAt")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt"));
b.Property("Xp")
.HasColumnType("bigint unsigned");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("CharacterId")
.HasColumnType("bigint unsigned");
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("ItemTemplateId")
.HasColumnType("bigint unsigned");
b.Property("SlotCode")
.HasColumnType("tinyint unsigned");
b.Property("UpdatedAt")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("CharacterId")
.HasColumnType("bigint unsigned");
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("ItemTemplateId")
.HasColumnType("bigint unsigned");
b.Property("Quantity")
.HasColumnType("int unsigned");
b.Property("SlotIndex")
.HasColumnType("int unsigned");
b.Property("UpdatedAt")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("ItemType")
.HasColumnType("tinyint unsigned");
b.Property("MaxStack")
.HasColumnType("int unsigned");
b.Property("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property("Rarity")
.HasColumnType("tinyint unsigned");
b.Property("StatsJson")
.HasColumnType("json");
b.Property("UpdatedAt")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt"));
b.Property("Weight")
.HasColumnType("int unsigned");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("item_templates", (string)null);
});
modelBuilder.Entity("Server.Data.Session", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("AccountId")
.HasColumnType("bigint unsigned");
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("CreatedIp")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property("ExpiresAt")
.HasColumnType("datetime(6)");
b.Property("RevokedAt")
.HasColumnType("datetime(6)");
b.Property("TokenHash")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
b.Property("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
b.Property("MaxX")
.HasColumnType("double");
b.Property("MaxY")
.HasColumnType("double");
b.Property("MaxZ")
.HasColumnType("double");
b.Property("MinX")
.HasColumnType("double");
b.Property("MinY")
.HasColumnType("double");
b.Property("MinZ")
.HasColumnType("double");
b.Property("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property("UpdatedAt")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime(6)")
.HasDefaultValueSql("CURRENT_TIMESTAMP(6)");
MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("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.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
}
}
}