feat: мультироль
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 2m6s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 26s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 2m6s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 26s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
This commit is contained in:
@@ -15,7 +15,6 @@ public class UserConfiguration : IEntityTypeConfiguration<User>
|
||||
builder.Property(u => u.Email).HasColumnName("email").HasMaxLength(255).IsRequired();
|
||||
builder.Property(u => u.DisplayName).HasColumnName("display_name").HasMaxLength(255);
|
||||
builder.Property(u => u.AvatarUrl).HasColumnName("avatar_url").HasMaxLength(500);
|
||||
builder.Property(u => u.Role).HasColumnName("role");
|
||||
builder.Property(u => u.IsActive).HasColumnName("is_active").HasDefaultValue(true);
|
||||
builder.Property(u => u.MicrosoftId).HasColumnName("microsoft_id").HasMaxLength(255);
|
||||
builder.Property(u => u.Xp).HasColumnName("xp").HasDefaultValue(0);
|
||||
@@ -25,5 +24,10 @@ public class UserConfiguration : IEntityTypeConfiguration<User>
|
||||
|
||||
builder.HasIndex(u => u.Email).IsUnique();
|
||||
builder.HasIndex(u => u.MicrosoftId).IsUnique().HasFilter("microsoft_id IS NOT NULL");
|
||||
|
||||
builder.HasMany(u => u.Roles)
|
||||
.WithOne(ur => ur.User)
|
||||
.HasForeignKey(ur => ur.UserId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user