< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Alterations.Configurations
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Alterations/Configurations.cs
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Configure(...)100%11100%
Configure(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Alterations/Configurations.cs

#LineLine coverage
 1using Elsa.Alterations.Core.Entities;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace Elsa.Persistence.EFCore.Modules.Alterations;
 6
 7/// <summary>
 8/// EF Core configuration for various entity types.
 9/// </summary>
 10public class Configurations : IEntityTypeConfiguration<AlterationPlan>, IEntityTypeConfiguration<AlterationJob>
 11{
 12    /// <inheritdoc />
 13    public void Configure(EntityTypeBuilder<AlterationPlan> builder)
 14    {
 115        builder.Ignore(x => x.Alterations);
 116        builder.Ignore(x => x.WorkflowInstanceFilter);
 117        builder.Property<string>("SerializedAlterations");
 118        builder.Property<string>("SerializedWorkflowInstanceFilter");
 119        builder.Property(x => x.Status).HasConversion<string>();
 120        builder.HasIndex(x => x.Status).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.Status)}");
 121        builder.HasIndex(x => x.CreatedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.CreatedA
 122        builder.HasIndex(x => x.StartedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.StartedA
 123        builder.HasIndex(x => x.CompletedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.Comple
 124        builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.TenantId)
 125    }
 26
 27    /// <inheritdoc />
 28    public void Configure(EntityTypeBuilder<AlterationJob> builder)
 29    {
 130        builder.Ignore(x => x.Log);
 131        builder.Property<string>("SerializedLog");
 132        builder.Property(x => x.Status).HasConversion<string>();
 133        builder.HasIndex(x => x.PlanId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.PlanId)}");
 134        builder.HasIndex(x => x.WorkflowInstanceId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.W
 135        builder.HasIndex(x => x.Status).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.Status)}");
 136        builder.HasIndex(x => x.CreatedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.CreatedAt)
 137        builder.HasIndex(x => x.StartedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.StartedAt)
 138        builder.HasIndex(x => x.CompletedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.Complete
 139        builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.TenantId)}"
 140    }
 41}