| | | 1 | | using Elsa.KeyValues.Entities; |
| | | 2 | | using Elsa.Workflows.Runtime.Entities; |
| | | 3 | | using Microsoft.EntityFrameworkCore; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Persistence.EFCore.Modules.Runtime; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// DB context for the runtime module. |
| | | 9 | | /// </summary> |
| | | 10 | | public class RuntimeElsaDbContext : ElsaDbContextBase |
| | | 11 | | { |
| | | 12 | | /// <inheritdoc /> |
| | 2665 | 13 | | public RuntimeElsaDbContext(DbContextOptions<RuntimeElsaDbContext> options, IServiceProvider serviceProvider) : base |
| | | 14 | | { |
| | 2665 | 15 | | } |
| | | 16 | | |
| | | 17 | | #region Obsolete |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// The workflow inbox messages. |
| | | 21 | | /// </summary> |
| | | 22 | | [Obsolete("Use BookmarkQueueItems instead.")] |
| | 2665 | 23 | | public DbSet<WorkflowInboxMessage> WorkflowInboxMessages { get; set; } = null!; |
| | | 24 | | |
| | | 25 | | #endregion |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// The workflow triggers. |
| | | 29 | | /// </summary> |
| | 2665 | 30 | | public DbSet<StoredTrigger> Triggers { get; set; } = null!; |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// The workflow execution log records. |
| | | 34 | | /// </summary> |
| | 2665 | 35 | | public DbSet<WorkflowExecutionLogRecord> WorkflowExecutionLogRecords { get; set; } = null!; |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// The activity execution records. |
| | | 39 | | /// </summary> |
| | 2665 | 40 | | public DbSet<ActivityExecutionRecord> ActivityExecutionRecords { get; set; } = null!; |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// The workflow bookmarks. |
| | | 44 | | /// </summary> |
| | 2665 | 45 | | public DbSet<StoredBookmark> Bookmarks { get; set; } = null!; |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// The bookmark queue items. |
| | | 49 | | /// </summary> |
| | 2665 | 50 | | public DbSet<BookmarkQueueItem> BookmarkQueueItems { get; set; } = null!; |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// The generic key value pairs. |
| | | 54 | | /// </summary> |
| | 2665 | 55 | | public DbSet<SerializedKeyValuePair> KeyValuePairs { get; set; } = null!; |
| | | 56 | | |
| | | 57 | | /// <inheritdoc /> |
| | | 58 | | protected override void OnModelCreating(ModelBuilder modelBuilder) |
| | | 59 | | { |
| | 1 | 60 | | var config = new Configurations(); |
| | 1 | 61 | | modelBuilder.ApplyConfiguration<StoredTrigger>(config); |
| | 1 | 62 | | modelBuilder.ApplyConfiguration<WorkflowExecutionLogRecord>(config); |
| | 1 | 63 | | modelBuilder.ApplyConfiguration<ActivityExecutionRecord>(config); |
| | 1 | 64 | | modelBuilder.ApplyConfiguration<StoredBookmark>(config); |
| | 1 | 65 | | modelBuilder.ApplyConfiguration<BookmarkQueueItem>(config); |
| | 1 | 66 | | modelBuilder.ApplyConfiguration<SerializedKeyValuePair>(config); |
| | 1 | 67 | | modelBuilder.ApplyConfiguration<WorkflowInboxMessage>(config); |
| | | 68 | | |
| | 1 | 69 | | base.OnModelCreating(modelBuilder); |
| | 1 | 70 | | } |
| | | 71 | | } |