2025-09-24 19:36:28 +02:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
2026-01-11 02:30:08 +01:00
|
|
|
|
using TimetableDesigner.Backend.Services.Authentication.Database.Model;
|
2025-09-24 19:36:28 +02:00
|
|
|
|
|
2026-01-11 02:30:08 +01:00
|
|
|
|
namespace TimetableDesigner.Backend.Services.Authentication.Database.Configuration;
|
2025-09-24 19:36:28 +02:00
|
|
|
|
|
|
|
|
|
|
public class AccountConfiguration : IEntityTypeConfiguration<Account>
|
|
|
|
|
|
{
|
|
|
|
|
|
public void Configure(EntityTypeBuilder<Account> builder)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.HasKey(x => x.Id);
|
|
|
|
|
|
builder.HasIndex(x => x.Id)
|
|
|
|
|
|
.IsUnique();
|
|
|
|
|
|
builder.Property(x => x.Id)
|
|
|
|
|
|
.IsRequired()
|
|
|
|
|
|
.UseIdentityAlwaysColumn();
|
|
|
|
|
|
|
|
|
|
|
|
builder.Property(x => x.Email)
|
|
|
|
|
|
.HasMaxLength(320)
|
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
|
|
builder.Property(x => x.Password)
|
|
|
|
|
|
.HasMaxLength(1000)
|
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
2026-01-14 01:37:46 +01:00
|
|
|
|
builder.Property(x => x.PasswordSalt)
|
2025-09-24 19:36:28 +02:00
|
|
|
|
.HasMaxLength(20)
|
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
|
|
builder.Property(b => b.Version)
|
|
|
|
|
|
.IsRowVersion();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|