18 lines
702 B
C#
18 lines
702 B
C#
using Heimdall.Domain.Entities;
|
|||
|
|
using Microsoft.EntityFrameworkCore;
|
||
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||
|
|
|
||
|
|
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);
|
||
|
|
builder.HasOne<AppUser>().WithMany().HasForeignKey(x => x.UserId).OnDelete(DeleteBehavior.Cascade);
|
||
|
|
}
|
||
|
|
}
|