mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Update ScriptRun/ScriptResult relationship.
This commit is contained in:
parent
cf0fad5c42
commit
459c63ffbe
@ -41,7 +41,7 @@ public class AppDb : IdentityDbContext
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
{
|
||||
options.ConfigureWarnings(x => x.Ignore(RelationalEventId.MultipleCollectionIncludeWarning));
|
||||
//options.LogTo((message) => System.Diagnostics.Debug.Write(message));
|
||||
options.LogTo((message) => System.Diagnostics.Debug.Write(message));
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
@ -157,6 +157,10 @@ public class AppDb : IdentityDbContext
|
||||
builder.Entity<ScriptRun>()
|
||||
.HasMany(x => x.Devices)
|
||||
.WithMany(x => x.ScriptRuns);
|
||||
builder.Entity<ScriptRun>()
|
||||
.HasMany(x => x.Results)
|
||||
.WithOne(x => x.ScriptRun)
|
||||
.IsRequired(false);
|
||||
|
||||
builder.Entity<ScriptResult>()
|
||||
.Property(x => x.ErrorOutput)
|
||||
@ -173,6 +177,10 @@ public class AppDb : IdentityDbContext
|
||||
x => DeserializeStringArray(x, jsonOptions))
|
||||
.Metadata
|
||||
.SetValueComparer(_stringArrayComparer);
|
||||
builder.Entity<ScriptResult>()
|
||||
.HasOne(x => x.ScriptRun)
|
||||
.WithMany(x => x.Results)
|
||||
.IsRequired(false);
|
||||
|
||||
builder.Entity<Alert>()
|
||||
.HasOne(x => x.User)
|
||||
|
||||
@ -43,6 +43,7 @@ public class ScriptResult
|
||||
public int? ScheduleId { get; set; }
|
||||
public Guid? SavedScriptId { get; set; }
|
||||
|
||||
public ScriptRun? ScriptRun { get; set; }
|
||||
public int? ScriptRunId { get; set; }
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user