Heimdall Gitea / Detect CI scope (pull_request) Successful in 6s
Heimdall Gitea / Build and tests (pull_request) Failing after 4m5s
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Failing after 1s
84 lines
2.3 KiB
C#
84 lines
2.3 KiB
C#
using Heimdall.Domain.Entities;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
using Heimdall.Infrastructure.Identity;
|
|
namespace Heimdall.Infrastructure.Data.Configurations;
|
|
|
|
public class IdentityAppUserConfiguration : IEntityTypeConfiguration<IdentityAppUser>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityAppUser> builder)
|
|
{
|
|
builder.ToTable("users");
|
|
|
|
builder.Property(u => u.DisplayName)
|
|
.HasMaxLength(200)
|
|
.IsRequired();
|
|
|
|
builder.Property(u => u.Theme)
|
|
.HasMaxLength(20)
|
|
.HasDefaultValue("Auto")
|
|
.IsUnicode(false);
|
|
|
|
builder.Property(u => u.Language)
|
|
.HasMaxLength(10)
|
|
.HasDefaultValue("fr")
|
|
.IsUnicode(false);
|
|
|
|
builder.Property(u => u.CreatedAt)
|
|
.HasDefaultValueSql("NOW()");
|
|
|
|
builder.Property(u => u.MustChangePassword)
|
|
.HasDefaultValue(false);
|
|
}
|
|
}
|
|
|
|
public class IdentityAppRoleConfiguration : IEntityTypeConfiguration<IdentityAppRole>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityAppRole> builder)
|
|
{
|
|
builder.ToTable("roles");
|
|
}
|
|
}
|
|
|
|
public class IdentityUserRoleConfiguration : IEntityTypeConfiguration<IdentityUserRole<Guid>>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityUserRole<Guid>> builder)
|
|
{
|
|
builder.ToTable("user_roles");
|
|
}
|
|
}
|
|
|
|
public class IdentityUserClaimConfiguration : IEntityTypeConfiguration<IdentityUserClaim<Guid>>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityUserClaim<Guid>> builder)
|
|
{
|
|
builder.ToTable("user_claims");
|
|
}
|
|
}
|
|
|
|
public class IdentityUserLoginConfiguration : IEntityTypeConfiguration<IdentityUserLogin<Guid>>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityUserLogin<Guid>> builder)
|
|
{
|
|
builder.ToTable("user_logins");
|
|
}
|
|
}
|
|
|
|
public class IdentityRoleClaimConfiguration : IEntityTypeConfiguration<IdentityRoleClaim<Guid>>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityRoleClaim<Guid>> builder)
|
|
{
|
|
builder.ToTable("role_claims");
|
|
}
|
|
}
|
|
|
|
public class IdentityUserTokenConfiguration : IEntityTypeConfiguration<IdentityUserToken<Guid>>
|
|
{
|
|
public void Configure(EntityTypeBuilder<IdentityUserToken<Guid>> builder)
|
|
{
|
|
builder.ToTable("user_tokens");
|
|
}
|
|
}
|