Change to static skin catalog population

This commit is contained in:
bob
2026-05-29 18:36:17 -05:00
parent 6f3c0175cd
commit b51f1d9f5f
26 changed files with 3063 additions and 370 deletions

View File

@@ -8,20 +8,27 @@ public class SkinConfiguration : IEntityTypeConfiguration<Skin>
{
public void Configure(EntityTypeBuilder<Skin> entity)
{
entity.Property(e => e.FloatMin)
.HasColumnType("numeric(10,9)")
.HasDefaultValue(0.0m);
entity.Property(e => e.FloatMax)
.HasColumnType("numeric(10,9)")
.HasDefaultValue(1.0m);
// Nullable: null means the catalogue gives no wear range (e.g. vanilla
// knives), distinct from a genuine 0.01.0 range.
entity.Property(e => e.FloatMin).HasColumnType("numeric(10,9)");
entity.Property(e => e.FloatMax).HasColumnType("numeric(10,9)");
entity.Property(e => e.TrueFloat)
.HasComputedColumnSql("float_min = 0.0 AND float_max = 1.0", stored: true);
entity.HasIndex(e => e.TrueFloat);
// Slug is the natural key the sync upserts against.
entity.HasIndex(e => e.Slug).IsUnique();
entity.HasOne(e => e.Weapon)
.WithMany(w => w.Skins)
.HasForeignKey(e => e.WeaponId);
// A skin can come from many collections and containers, and each of those
// holds many skins.
entity.HasMany(e => e.Collections)
.WithMany(c => c.Skins)
.UsingEntity(join => join.ToTable("skin_collections"));
}
}