add csfloat api usage

This commit is contained in:
bob
2026-05-29 22:08:32 -05:00
parent b51f1d9f5f
commit d1752b1b07
37 changed files with 6095 additions and 22 deletions

View File

@@ -21,6 +21,18 @@ public class SkinConfiguration : IEntityTypeConfiguration<Skin>
// Slug is the natural key the sync upserts against.
entity.HasIndex(e => e.Slug).IsUnique();
// Market listings join back to a skin by (def_index, paint_index). Unique
// among populated rows; filtered so the many catalogue rows that predate
// these columns (null) don't collide. Postgres treats nulls as distinct
// anyway, but the filter makes the intent explicit and the index smaller.
entity.HasIndex(e => new { e.DefIndex, e.PaintIndex })
.IsUnique()
.HasFilter("def_index IS NOT NULL AND paint_index IS NOT NULL");
// The catalogue sweep orders skins by when they were last swept (nulls
// first) to resume across capped runs; index that ordering.
entity.HasIndex(e => e.ListingsSweptAt);
entity.HasOne(e => e.Weapon)
.WithMany(w => w.Skins)
.HasForeignKey(e => e.WeaponId);