almost ready
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using BlueLaminate.EFCore.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace BlueLaminate.EFCore.Configurations;
|
||||
|
||||
public class SkinSweepConfiguration : IEntityTypeConfiguration<SkinSweep>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SkinSweep> entity)
|
||||
{
|
||||
// One checkpoint per skin per site: the natural key the upsert relies on.
|
||||
entity.HasIndex(e => new { e.SkinId, e.Source }).IsUnique();
|
||||
|
||||
// Mirror SkinConditionSweep: index the (source, swept_at) ordering each sweep scans.
|
||||
entity.HasIndex(e => new { e.Source, e.SweptAt });
|
||||
|
||||
entity.HasOne(e => e.Skin)
|
||||
.WithMany(s => s.Sweeps)
|
||||
.HasForeignKey(e => e.SkinId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user