| | | 1 | | using Elsa.Alterations.Core.Entities; |
| | | 2 | | using Microsoft.EntityFrameworkCore; |
| | | 3 | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Persistence.EFCore.Modules.Alterations; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// EF Core configuration for various entity types. |
| | | 9 | | /// </summary> |
| | | 10 | | public class Configurations : IEntityTypeConfiguration<AlterationPlan>, IEntityTypeConfiguration<AlterationJob> |
| | | 11 | | { |
| | | 12 | | /// <inheritdoc /> |
| | | 13 | | public void Configure(EntityTypeBuilder<AlterationPlan> builder) |
| | | 14 | | { |
| | 1 | 15 | | builder.Ignore(x => x.Alterations); |
| | 1 | 16 | | builder.Ignore(x => x.WorkflowInstanceFilter); |
| | 1 | 17 | | builder.Property<string>("SerializedAlterations"); |
| | 1 | 18 | | builder.Property<string>("SerializedWorkflowInstanceFilter"); |
| | 1 | 19 | | builder.Property(x => x.Status).HasConversion<string>(); |
| | 1 | 20 | | builder.HasIndex(x => x.Status).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.Status)}"); |
| | 1 | 21 | | builder.HasIndex(x => x.CreatedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.CreatedA |
| | 1 | 22 | | builder.HasIndex(x => x.StartedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.StartedA |
| | 1 | 23 | | builder.HasIndex(x => x.CompletedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.Comple |
| | 1 | 24 | | builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.TenantId) |
| | 1 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <inheritdoc /> |
| | | 28 | | public void Configure(EntityTypeBuilder<AlterationJob> builder) |
| | | 29 | | { |
| | 1 | 30 | | builder.Ignore(x => x.Log); |
| | 1 | 31 | | builder.Property<string>("SerializedLog"); |
| | 1 | 32 | | builder.Property(x => x.Status).HasConversion<string>(); |
| | 1 | 33 | | builder.HasIndex(x => x.PlanId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.PlanId)}"); |
| | 1 | 34 | | builder.HasIndex(x => x.WorkflowInstanceId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.W |
| | 1 | 35 | | builder.HasIndex(x => x.Status).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.Status)}"); |
| | 1 | 36 | | builder.HasIndex(x => x.CreatedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.CreatedAt) |
| | 1 | 37 | | builder.HasIndex(x => x.StartedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.StartedAt) |
| | 1 | 38 | | builder.HasIndex(x => x.CompletedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.Complete |
| | 1 | 39 | | builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.TenantId)}" |
| | 1 | 40 | | } |
| | | 41 | | } |