2026-10-20 07:21:28 +02:00
|
|
|
using Heimdall.Domain.Entities;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
2026-11-04 11:37:53 +01:00
|
|
|
using Heimdall.Infrastructure.Identity;
|
2026-10-20 07:21:28 +02:00
|
|
|
namespace Heimdall.Infrastructure.Data.Configurations;
|
|
|
|
|
|
|
|
|
|
public class LoginChallengeConfiguration : IEntityTypeConfiguration<LoginChallenge>
|
|
|
|
|
{
|
|
|
|
|
public void Configure(EntityTypeBuilder<LoginChallenge> builder)
|
|
|
|
|
{
|
|
|
|
|
builder.ToTable("login_challenges");
|
|
|
|
|
builder.HasKey(x => x.Id);
|
|
|
|
|
builder.Property(x => x.Id).HasMaxLength(64);
|
|
|
|
|
builder.Property(x => x.SecurityStamp).HasMaxLength(256);
|
|
|
|
|
builder.HasIndex(x => x.ExpiresAt);
|
2026-11-04 11:37:53 +01:00
|
|
|
builder.HasOne<IdentityAppUser>().WithMany().HasForeignKey(x => x.UserId).OnDelete(DeleteBehavior.Cascade);
|
2026-10-20 07:21:28 +02:00
|
|
|
}
|
|
|
|
|
}
|