| | | 1 | | using Elsa.Alterations.Core.Entities; |
| | | 2 | | using Elsa.Alterations.Core.Models; |
| | | 3 | | using Elsa.Workflows.Management.Models; |
| | | 4 | | using JetBrains.Annotations; |
| | | 5 | | using Microsoft.EntityFrameworkCore; |
| | | 6 | | |
| | | 7 | | namespace Elsa.Persistence.EFCore.Modules.Alterations; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// DB context for the runtime module. |
| | | 11 | | /// </summary> |
| | | 12 | | [UsedImplicitly] |
| | | 13 | | public class AlterationsElsaDbContext : ElsaDbContextBase |
| | | 14 | | { |
| | | 15 | | /// <inheritdoc /> |
| | 1 | 16 | | public AlterationsElsaDbContext(DbContextOptions<AlterationsElsaDbContext> options, IServiceProvider serviceProvider |
| | | 17 | | { |
| | 1 | 18 | | } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The alteration plans. |
| | | 22 | | /// </summary> |
| | 1 | 23 | | public DbSet<AlterationPlan> AlterationPlans { get; set; } = null!; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The alteration jobs. |
| | | 27 | | /// </summary> |
| | 1 | 28 | | public DbSet<AlterationJob> AlterationJobs { get; set; } = null!; |
| | | 29 | | |
| | | 30 | | /// <inheritdoc /> |
| | | 31 | | protected override void OnModelCreating(ModelBuilder modelBuilder) |
| | | 32 | | { |
| | 1 | 33 | | modelBuilder.Ignore<AlterationLogEntry>(); |
| | 1 | 34 | | modelBuilder.Ignore<AlterationWorkflowInstanceFilter>(); |
| | 1 | 35 | | modelBuilder.Ignore<TimestampFilter>(); |
| | | 36 | | |
| | 1 | 37 | | var configuration = new Configurations(); |
| | 1 | 38 | | modelBuilder.ApplyConfiguration<AlterationPlan>(configuration); |
| | 1 | 39 | | modelBuilder.ApplyConfiguration<AlterationJob>(configuration); |
| | 1 | 40 | | base.OnModelCreating(modelBuilder); |
| | 1 | 41 | | } |
| | | 42 | | } |