forked from ddrilling/AsbCloudServer
fix AsbCloudDbContext.RelationUserRolePermissions
This commit is contained in:
parent
43bdc9e92e
commit
e99f0ff9c9
@ -41,7 +41,7 @@ namespace AsbCloudDb.Model
|
||||
public virtual DbSet<DrillFlowChart> DrillFlowChart { get; set; }
|
||||
public virtual DbSet<RelationUserUserRole> RelationUserUserRoles { get; set; }
|
||||
public virtual DbSet<Permission> Permissions { get; set; }
|
||||
public virtual DbSet<Permission> PermissionInfos { get; set; }
|
||||
public virtual DbSet<RelationUserRolePermission> RelationUserRolePermissions { get; set; }
|
||||
|
||||
//var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
|
||||
// .UseNpgsql("Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True")
|
||||
@ -217,12 +217,6 @@ namespace AsbCloudDb.Model
|
||||
|
||||
modelBuilder.Entity<DrillParams>(entity =>
|
||||
{
|
||||
// entity.HasOne(d => d.Well)
|
||||
// .WithOne(p => p.)
|
||||
// .HasForeignKey<Well>(d => d.IdTelemetry)
|
||||
// .OnDelete(DeleteBehavior.SetNull)
|
||||
// .HasConstraintName("t_well_t_telemetry_id_fk");
|
||||
|
||||
entity.HasOne(r => r.WellSectionType)
|
||||
.WithMany(w => w.DrillParamsCollection)
|
||||
.HasForeignKey(r => r.IdWellSectionType)
|
||||
@ -257,6 +251,14 @@ namespace AsbCloudDb.Model
|
||||
modelBuilder.Entity<RelationUserRolePermission>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.IdUserRole, e.IdPermission });
|
||||
|
||||
entity.HasOne(r => r.Permission)
|
||||
.WithMany(p => p.RelationUserRolePermissions)
|
||||
.IsRequired();
|
||||
|
||||
entity.HasOne(r => r.UserRole)
|
||||
.WithMany(r => r.RelationUserRolePermissions)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
FillData(modelBuilder);
|
||||
|
@ -38,7 +38,7 @@ namespace AsbCloudDb.Model
|
||||
DbSet<DrillFlowChart> DrillFlowChart { get; set; }
|
||||
DbSet<RelationUserUserRole> RelationUserUserRoles { get; set; }
|
||||
DbSet<Permission> Permissions { get; set; }
|
||||
DbSet<Permission> PermissionInfos { get; set; }
|
||||
DbSet<RelationUserRolePermission> RelationUserRolePermissions { get; set; }
|
||||
|
||||
DatabaseFacade Database { get; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user