From d1da8b14ac3490124a921caedc8bf90e855e2ff8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 12:24:15 +0000 Subject: [PATCH 1/5] Initial plan From 7af6dc869db3bfe65034a351dffb36dd66fba033 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 12:47:03 +0000 Subject: [PATCH 2/5] Increase ActivityNodeId column max length from 450 to 1024 to fix truncation for deeply nested workflows Add HasMaxLength(1024) for ActivityNodeId on ActivityExecutionRecord and WorkflowExecutionLogRecord entities. Create V3_7 migrations for all 5 database providers (SqlServer, MySql, PostgreSql, Sqlite, Oracle). Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> --- .../Runtime/20260302123620_V3_7.Designer.cs | 512 +++++++++++++++++ .../Migrations/Runtime/20260302123620_V3_7.cs | 74 +++ .../RuntimeElsaDbContextModelSnapshot.cs | 8 +- .../Runtime/20260302124146_V3_7.Designer.cs | 494 +++++++++++++++++ .../Migrations/Runtime/20260302124146_V3_7.cs | 66 +++ .../RuntimeElsaDbContextModelSnapshot.cs | 6 +- .../Runtime/20260302123852_V3_7.Designer.cs | 512 +++++++++++++++++ .../Migrations/Runtime/20260302123852_V3_7.cs | 66 +++ .../RuntimeElsaDbContextModelSnapshot.cs | 8 +- .../Runtime/20260302123412_V3_7.Designer.cs | 513 ++++++++++++++++++ .../Migrations/Runtime/20260302123412_V3_7.cs | 66 +++ .../RuntimeElsaDbContextModelSnapshot.cs | 8 +- .../Runtime/20260302124019_V3_7.Designer.cs | 508 +++++++++++++++++ .../Migrations/Runtime/20260302124019_V3_7.cs | 28 + .../RuntimeElsaDbContextModelSnapshot.cs | 4 +- .../Modules/Runtime/Configurations.cs | 2 + 16 files changed, 2863 insertions(+), 12 deletions(-) create mode 100644 src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs create mode 100644 src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs new file mode 100644 index 0000000000..175fc24536 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs @@ -0,0 +1,512 @@ +// +using System; +using Elsa.Persistence.EFCore.Modules.Runtime; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime +{ + [DbContext(typeof(RuntimeElsaDbContext))] + [Migration("20260302123620_V3_7")] + partial class V3_7 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Elsa") + .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("SerializedValue") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); + + b.ToTable("KeyValuePairs", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ActivityName") + .HasColumnType("varchar(255)"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ActivityTypeVersion") + .HasColumnType("int"); + + b.Property("AggregateFaultCount") + .HasColumnType("int"); + + b.Property("CompletedAt") + .HasColumnType("datetime(6)"); + + b.Property("HasBookmarks") + .HasColumnType("tinyint(1)"); + + b.Property("SerializedActivityState") + .HasColumnType("longtext"); + + b.Property("SerializedActivityStateCompressionAlgorithm") + .HasColumnType("longtext"); + + b.Property("SerializedException") + .HasColumnType("longtext"); + + b.Property("SerializedMetadata") + .HasColumnType("longtext"); + + b.Property("SerializedOutputs") + .HasColumnType("longtext"); + + b.Property("SerializedPayload") + .HasColumnType("longtext"); + + b.Property("SerializedProperties") + .HasColumnType("longtext"); + + b.Property("StartedAt") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("varchar(255)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); + + b.HasIndex("CompletedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); + + b.HasIndex("HasBookmarks") + .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); + + b.HasIndex("StartedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); + + b.HasIndex("Status") + .HasDatabaseName("IX_ActivityExecutionRecord_Status"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); + + b.ToTable("ActivityExecutionRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActivityInstanceId") + .HasColumnType("varchar(255)"); + + b.Property("ActivityTypeName") + .HasColumnType("varchar(255)"); + + b.Property("BookmarkId") + .HasColumnType("varchar(255)"); + + b.Property("CorrelationId") + .HasColumnType("varchar(255)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("SerializedOptions") + .HasColumnType("longtext"); + + b.Property("StimulusHash") + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("varchar(255)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); + + b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); + + b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); + + b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); + + b.ToTable("BookmarkQueueItems", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActivityInstanceId") + .HasColumnType("varchar(255)"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CorrelationId") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("SerializedMetadata") + .HasColumnType("longtext"); + + b.Property("SerializedPayload") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("varchar(255)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); + + b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); + + b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); + + b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); + + b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); + + b.ToTable("Bookmarks", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("SerializedPayload") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("varchar(255)"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("Hash") + .HasDatabaseName("IX_StoredTrigger_Hash"); + + b.HasIndex("Name") + .HasDatabaseName("IX_StoredTrigger_Name"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_StoredTrigger_TenantId"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId") + .IsUnique() + .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId"); + + b.ToTable("Triggers", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ActivityInstanceId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ActivityName") + .HasColumnType("varchar(255)"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ActivityTypeVersion") + .HasColumnType("int"); + + b.Property("EventName") + .HasColumnType("varchar(255)"); + + b.Property("Message") + .HasColumnType("longtext"); + + b.Property("ParentActivityInstanceId") + .HasColumnType("varchar(255)"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("SerializedActivityState") + .HasColumnType("longtext"); + + b.Property("SerializedPayload") + .HasColumnType("longtext"); + + b.Property("Source") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("varchar(255)"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("WorkflowVersion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); + + b.HasIndex("ActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); + + b.HasIndex("EventName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); + + b.HasIndex("ParentActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); + + b.HasIndex("Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); + + b.HasIndex("Timestamp") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); + + b.HasIndex("WorkflowVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); + + b.HasIndex("Timestamp", "Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); + + b.ToTable("WorkflowExecutionLogRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActivityInstanceId") + .HasColumnType("varchar(255)"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("CorrelationId") + .HasColumnType("varchar(255)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("ExpiresAt") + .HasColumnType("datetime(6)"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("SerializedBookmarkPayload") + .HasColumnType("longtext"); + + b.Property("SerializedInput") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("longtext"); + + b.Property("WorkflowInstanceId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); + + b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); + + b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); + + b.ToTable("WorkflowInboxMessages", "Elsa"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs new file mode 100644 index 0000000000..9de5b0e2e2 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs @@ -0,0 +1,74 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime +{ + /// + public partial class V3_7 : Migration + { + private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; + + /// + public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) + { + _schema = schema; + } + + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "varchar(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "varchar(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "varchar(255)", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(1024)", + oldMaxLength: 1024) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "varchar(255)", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(1024)", + oldMaxLength: 1024) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index f7add71af7..2b541f2bbe 100644 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("ProductVersion", "9.0.13") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); @@ -56,7 +56,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("varchar(255)"); + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); b.Property("ActivityType") .IsRequired() @@ -339,7 +340,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("varchar(255)"); + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); b.Property("ActivityType") .IsRequired() diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs new file mode 100644 index 0000000000..16e040273f --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs @@ -0,0 +1,494 @@ +// +using System; +using Elsa.Persistence.EFCore.Modules.Runtime; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Oracle.EntityFrameworkCore.Metadata; + +#nullable disable + +namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime +{ + [DbContext(typeof(RuntimeElsaDbContext))] + [Migration("20260302124146_V3_7")] + partial class V3_7 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Elsa") + .HasAnnotation("ProductVersion", "8.0.12") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("SerializedValue") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); + + b.ToTable("KeyValuePairs", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityName") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("NVARCHAR2(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityTypeVersion") + .HasColumnType("NUMBER(10)"); + + b.Property("CompletedAt") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("HasBookmarks") + .HasColumnType("BOOLEAN"); + + b.Property("SerializedActivityState") + .HasColumnType("NCLOB"); + + b.Property("SerializedActivityStateCompressionAlgorithm") + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("SerializedException") + .HasColumnType("NCLOB"); + + b.Property("SerializedOutputs") + .HasColumnType("NCLOB"); + + b.Property("SerializedPayload") + .HasColumnType("NCLOB"); + + b.Property("SerializedProperties") + .HasColumnType("NCLOB"); + + b.Property("StartedAt") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); + + b.HasIndex("CompletedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); + + b.HasIndex("HasBookmarks") + .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); + + b.HasIndex("StartedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); + + b.HasIndex("Status") + .HasDatabaseName("IX_ActivityExecutionRecord_Status"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); + + b.ToTable("ActivityExecutionRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityInstanceId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityTypeName") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("BookmarkId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("CorrelationId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("SerializedOptions") + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("StimulusHash") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("NVARCHAR2(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); + + b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); + + b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); + + b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); + + b.ToTable("BookmarkQueueItems", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityInstanceId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("CorrelationId") + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("SerializedMetadata") + .HasColumnType("NCLOB"); + + b.Property("SerializedPayload") + .HasColumnType("NCLOB"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); + + b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); + + b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); + + b.ToTable("Bookmarks", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("Hash") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("SerializedPayload") + .HasColumnType("NCLOB"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.HasKey("Id"); + + b.HasIndex("Hash") + .HasDatabaseName("IX_StoredTrigger_Hash"); + + b.HasIndex("Name") + .HasDatabaseName("IX_StoredTrigger_Name"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_StoredTrigger_TenantId"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); + + b.ToTable("Triggers", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityInstanceId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityName") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("NVARCHAR2(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityTypeVersion") + .HasColumnType("NUMBER(10)"); + + b.Property("EventName") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("Message") + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("ParentActivityInstanceId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("Sequence") + .HasColumnType("NUMBER(19)"); + + b.Property("SerializedActivityState") + .HasColumnType("NCLOB"); + + b.Property("SerializedPayload") + .HasColumnType("NCLOB"); + + b.Property("Source") + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("Timestamp") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("WorkflowVersion") + .HasColumnType("NUMBER(10)"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); + + b.HasIndex("ActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); + + b.HasIndex("EventName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); + + b.HasIndex("ParentActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); + + b.HasIndex("Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); + + b.HasIndex("Timestamp") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); + + b.HasIndex("WorkflowVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); + + b.HasIndex("Timestamp", "Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); + + b.ToTable("WorkflowExecutionLogRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => + { + b.Property("Id") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityInstanceId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("CorrelationId") + .HasColumnType("NVARCHAR2(450)"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("ExpiresAt") + .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("NVARCHAR2(450)"); + + b.Property("SerializedBookmarkPayload") + .HasColumnType("NCLOB"); + + b.Property("SerializedInput") + .HasColumnType("NCLOB"); + + b.Property("TenantId") + .HasColumnType("NVARCHAR2(2000)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("NVARCHAR2(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); + + b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); + + b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); + + b.ToTable("WorkflowInboxMessages", "Elsa"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs new file mode 100644 index 0000000000..c0623baeaf --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs @@ -0,0 +1,66 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime +{ + /// + public partial class V3_7 : Migration + { + private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; + + /// + public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) + { + _schema = schema; + } + + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "NVARCHAR2(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR2(450)"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "NVARCHAR2(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR2(450)"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "NVARCHAR2(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR2(1024)", + oldMaxLength: 1024); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "NVARCHAR2(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR2(1024)", + oldMaxLength: 1024); + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index cdee3d63e3..de6eb18490 100644 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -56,7 +56,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("NVARCHAR2(450)"); + .HasMaxLength(1024) + .HasColumnType("NVARCHAR2(1024)"); b.Property("ActivityType") .IsRequired() @@ -340,7 +341,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("NVARCHAR2(450)"); + .HasMaxLength(1024) + .HasColumnType("NVARCHAR2(1024)"); b.Property("ActivityType") .IsRequired() diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs new file mode 100644 index 0000000000..d7b65a0305 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs @@ -0,0 +1,512 @@ +// +using System; +using Elsa.Persistence.EFCore.Modules.Runtime; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime +{ + [DbContext(typeof(RuntimeElsaDbContext))] + [Migration("20260302123852_V3_7")] + partial class V3_7 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Elsa") + .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("SerializedValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); + + b.ToTable("KeyValuePairs", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityName") + .HasColumnType("text"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityTypeVersion") + .HasColumnType("integer"); + + b.Property("AggregateFaultCount") + .HasColumnType("integer"); + + b.Property("CompletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("HasBookmarks") + .HasColumnType("boolean"); + + b.Property("SerializedActivityState") + .HasColumnType("text"); + + b.Property("SerializedActivityStateCompressionAlgorithm") + .HasColumnType("text"); + + b.Property("SerializedException") + .HasColumnType("text"); + + b.Property("SerializedMetadata") + .HasColumnType("text"); + + b.Property("SerializedOutputs") + .HasColumnType("text"); + + b.Property("SerializedPayload") + .HasColumnType("text"); + + b.Property("SerializedProperties") + .HasColumnType("text"); + + b.Property("StartedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .IsRequired() + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); + + b.HasIndex("CompletedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); + + b.HasIndex("HasBookmarks") + .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); + + b.HasIndex("StartedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); + + b.HasIndex("Status") + .HasDatabaseName("IX_ActivityExecutionRecord_Status"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); + + b.ToTable("ActivityExecutionRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ActivityInstanceId") + .HasColumnType("text"); + + b.Property("ActivityTypeName") + .HasColumnType("text"); + + b.Property("BookmarkId") + .HasColumnType("text"); + + b.Property("CorrelationId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("SerializedOptions") + .HasColumnType("text"); + + b.Property("StimulusHash") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.Property("WorkflowInstanceId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); + + b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); + + b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); + + b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); + + b.ToTable("BookmarkQueueItems", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ActivityInstanceId") + .HasColumnType("text"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("text"); + + b.Property("CorrelationId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("SerializedMetadata") + .HasColumnType("text"); + + b.Property("SerializedPayload") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); + + b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); + + b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); + + b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); + + b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); + + b.ToTable("Bookmarks", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hash") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("SerializedPayload") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Hash") + .HasDatabaseName("IX_StoredTrigger_Hash"); + + b.HasIndex("Name") + .HasDatabaseName("IX_StoredTrigger_Name"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_StoredTrigger_TenantId"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId") + .IsUnique() + .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId"); + + b.ToTable("Triggers", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityInstanceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityName") + .HasColumnType("text"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityTypeVersion") + .HasColumnType("integer"); + + b.Property("EventName") + .HasColumnType("text"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("ParentActivityInstanceId") + .HasColumnType("text"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("SerializedActivityState") + .HasColumnType("text"); + + b.Property("SerializedPayload") + .HasColumnType("text"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkflowVersion") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); + + b.HasIndex("ActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); + + b.HasIndex("EventName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); + + b.HasIndex("ParentActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); + + b.HasIndex("Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); + + b.HasIndex("Timestamp") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); + + b.HasIndex("WorkflowVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); + + b.HasIndex("Timestamp", "Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); + + b.ToTable("WorkflowExecutionLogRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ActivityInstanceId") + .HasColumnType("text"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("text"); + + b.Property("CorrelationId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("text"); + + b.Property("SerializedBookmarkPayload") + .HasColumnType("text"); + + b.Property("SerializedInput") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("text"); + + b.Property("WorkflowInstanceId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); + + b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); + + b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); + + b.ToTable("WorkflowInboxMessages", "Elsa"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs new file mode 100644 index 0000000000..962cc05095 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs @@ -0,0 +1,66 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime +{ + /// + public partial class V3_7 : Migration + { + private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; + + /// + public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) + { + _schema = schema; + } + + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "character varying(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "character varying(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(1024)", + oldMaxLength: 1024); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(1024)", + oldMaxLength: 1024); + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 6b6665f499..a3d86e3eb7 100644 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("ProductVersion", "9.0.13") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -56,7 +56,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); b.Property("ActivityType") .IsRequired() @@ -339,7 +340,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); b.Property("ActivityType") .IsRequired() diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs new file mode 100644 index 0000000000..16eb194bf9 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs @@ -0,0 +1,513 @@ +// +using System; +using Elsa.Persistence.EFCore.Modules.Runtime; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime +{ + [DbContext(typeof(RuntimeElsaDbContext))] + [Migration("20260302123412_V3_7")] + partial class V3_7 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Elsa") + .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("SerializedValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); + + b.ToTable("KeyValuePairs", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityName") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityTypeVersion") + .HasColumnType("int"); + + b.Property("AggregateFaultCount") + .HasColumnType("int"); + + b.Property("CompletedAt") + .HasColumnType("datetimeoffset"); + + b.Property("HasBookmarks") + .HasColumnType("bit"); + + b.Property("SerializedActivityState") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedActivityStateCompressionAlgorithm") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedException") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedMetadata") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedOutputs") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedPayload") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("StartedAt") + .HasColumnType("datetimeoffset"); + + b.Property("Status") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); + + b.HasIndex("CompletedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); + + b.HasIndex("HasBookmarks") + .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); + + b.HasIndex("StartedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); + + b.HasIndex("Status") + .HasDatabaseName("IX_ActivityExecutionRecord_Status"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); + + b.ToTable("ActivityExecutionRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityInstanceId") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityTypeName") + .HasColumnType("nvarchar(450)"); + + b.Property("BookmarkId") + .HasColumnType("nvarchar(450)"); + + b.Property("CorrelationId") + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedAt") + .HasColumnType("datetimeoffset"); + + b.Property("SerializedOptions") + .HasColumnType("nvarchar(max)"); + + b.Property("StimulusHash") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); + + b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); + + b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); + + b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); + + b.ToTable("BookmarkQueueItems", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityInstanceId") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("CorrelationId") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetimeoffset"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("SerializedMetadata") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedPayload") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); + + b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); + + b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); + + b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); + + b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); + + b.ToTable("Bookmarks", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Hash") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("SerializedPayload") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Hash") + .HasDatabaseName("IX_StoredTrigger_Hash"); + + b.HasIndex("Name") + .HasDatabaseName("IX_StoredTrigger_Name"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_StoredTrigger_TenantId"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId", "TenantId") + .IsUnique() + .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId_TenantId") + .HasFilter("[Hash] IS NOT NULL"); + + b.ToTable("Triggers", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityInstanceId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityName") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityTypeVersion") + .HasColumnType("int"); + + b.Property("EventName") + .HasColumnType("nvarchar(450)"); + + b.Property("Message") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentActivityInstanceId") + .HasColumnType("nvarchar(450)"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("SerializedActivityState") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedPayload") + .HasColumnType("nvarchar(max)"); + + b.Property("Source") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(450)"); + + b.Property("Timestamp") + .HasColumnType("datetimeoffset"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowVersion") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); + + b.HasIndex("ActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); + + b.HasIndex("EventName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); + + b.HasIndex("ParentActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); + + b.HasIndex("Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); + + b.HasIndex("Timestamp") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); + + b.HasIndex("WorkflowVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); + + b.HasIndex("Timestamp", "Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); + + b.ToTable("WorkflowExecutionLogRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityInstanceId") + .HasColumnType("nvarchar(450)"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("CorrelationId") + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedAt") + .HasColumnType("datetimeoffset"); + + b.Property("ExpiresAt") + .HasColumnType("datetimeoffset"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("SerializedBookmarkPayload") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedInput") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); + + b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); + + b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); + + b.ToTable("WorkflowInboxMessages", "Elsa"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs new file mode 100644 index 0000000000..5889ef1690 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs @@ -0,0 +1,66 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime +{ + /// + public partial class V3_7 : Migration + { + private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; + + /// + public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) + { + _schema = schema; + } + + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "nvarchar(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "nvarchar(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "nvarchar(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(1024)", + oldMaxLength: 1024); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "nvarchar(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(1024)", + oldMaxLength: 1024); + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index b821c873fb..5b57b3b544 100644 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("ProductVersion", "9.0.13") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -56,7 +56,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); b.Property("ActivityType") .IsRequired() @@ -340,7 +341,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); b.Property("ActivityType") .IsRequired() diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs new file mode 100644 index 0000000000..fb30084943 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs @@ -0,0 +1,508 @@ +// +using System; +using Elsa.Persistence.EFCore.Modules.Runtime; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime +{ + [DbContext(typeof(RuntimeElsaDbContext))] + [Migration("20260302124019_V3_7")] + partial class V3_7 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Elsa") + .HasAnnotation("ProductVersion", "9.0.13"); + + modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("SerializedValue") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); + + b.ToTable("KeyValuePairs", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ActivityName") + .HasColumnType("TEXT"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("TEXT"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ActivityTypeVersion") + .HasColumnType("INTEGER"); + + b.Property("AggregateFaultCount") + .HasColumnType("INTEGER"); + + b.Property("CompletedAt") + .HasColumnType("TEXT"); + + b.Property("HasBookmarks") + .HasColumnType("INTEGER"); + + b.Property("SerializedActivityState") + .HasColumnType("TEXT"); + + b.Property("SerializedActivityStateCompressionAlgorithm") + .HasColumnType("TEXT"); + + b.Property("SerializedException") + .HasColumnType("TEXT"); + + b.Property("SerializedMetadata") + .HasColumnType("TEXT"); + + b.Property("SerializedOutputs") + .HasColumnType("TEXT"); + + b.Property("SerializedPayload") + .HasColumnType("TEXT"); + + b.Property("SerializedProperties") + .HasColumnType("TEXT"); + + b.Property("StartedAt") + .HasColumnType("TEXT"); + + b.Property("Status") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); + + b.HasIndex("CompletedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); + + b.HasIndex("HasBookmarks") + .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); + + b.HasIndex("StartedAt") + .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); + + b.HasIndex("Status") + .HasDatabaseName("IX_ActivityExecutionRecord_Status"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); + + b.ToTable("ActivityExecutionRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActivityInstanceId") + .HasColumnType("TEXT"); + + b.Property("ActivityTypeName") + .HasColumnType("TEXT"); + + b.Property("BookmarkId") + .HasColumnType("TEXT"); + + b.Property("CorrelationId") + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("SerializedOptions") + .HasColumnType("TEXT"); + + b.Property("StimulusHash") + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.Property("WorkflowInstanceId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); + + b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); + + b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); + + b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); + + b.ToTable("BookmarkQueueItems", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActivityInstanceId") + .HasColumnType("TEXT"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CorrelationId") + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("SerializedMetadata") + .HasColumnType("TEXT"); + + b.Property("SerializedPayload") + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); + + b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); + + b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); + + b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); + + b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); + + b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); + + b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); + + b.ToTable("Bookmarks", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Hash") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("SerializedPayload") + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Hash") + .HasDatabaseName("IX_StoredTrigger_Hash"); + + b.HasIndex("Name") + .HasDatabaseName("IX_StoredTrigger_Name"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_StoredTrigger_TenantId"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId") + .IsUnique() + .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId"); + + b.ToTable("Triggers", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActivityId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ActivityInstanceId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ActivityName") + .HasColumnType("TEXT"); + + b.Property("ActivityNodeId") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("TEXT"); + + b.Property("ActivityType") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ActivityTypeVersion") + .HasColumnType("INTEGER"); + + b.Property("EventName") + .HasColumnType("TEXT"); + + b.Property("Message") + .HasColumnType("TEXT"); + + b.Property("ParentActivityInstanceId") + .HasColumnType("TEXT"); + + b.Property("Sequence") + .HasColumnType("INTEGER"); + + b.Property("SerializedActivityState") + .HasColumnType("TEXT"); + + b.Property("SerializedPayload") + .HasColumnType("TEXT"); + + b.Property("Source") + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("WorkflowDefinitionId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("WorkflowDefinitionVersionId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("WorkflowInstanceId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("WorkflowVersion") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); + + b.HasIndex("ActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); + + b.HasIndex("ActivityName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); + + b.HasIndex("ActivityNodeId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); + + b.HasIndex("ActivityType") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); + + b.HasIndex("ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); + + b.HasIndex("EventName") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); + + b.HasIndex("ParentActivityInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); + + b.HasIndex("Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); + + b.HasIndex("TenantId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); + + b.HasIndex("Timestamp") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); + + b.HasIndex("WorkflowDefinitionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); + + b.HasIndex("WorkflowDefinitionVersionId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); + + b.HasIndex("WorkflowInstanceId") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); + + b.HasIndex("WorkflowVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); + + b.HasIndex("ActivityType", "ActivityTypeVersion") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); + + b.HasIndex("Timestamp", "Sequence") + .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); + + b.ToTable("WorkflowExecutionLogRecords", "Elsa"); + }); + + modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActivityInstanceId") + .HasColumnType("TEXT"); + + b.Property("ActivityTypeName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CorrelationId") + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("ExpiresAt") + .HasColumnType("TEXT"); + + b.Property("Hash") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SerializedBookmarkPayload") + .HasColumnType("TEXT"); + + b.Property("SerializedInput") + .HasColumnType("TEXT"); + + b.Property("TenantId") + .HasColumnType("TEXT"); + + b.Property("WorkflowInstanceId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); + + b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); + + b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); + + b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); + + b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); + + b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); + + b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); + + b.ToTable("WorkflowInboxMessages", "Elsa"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs new file mode 100644 index 0000000000..d80e1e5d10 --- /dev/null +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime +{ + /// + public partial class V3_7 : Migration + { + private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; + + /// + public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) + { + _schema = schema; + } + + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + } + } +} diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 74fbd62105..fbc73ef9bb 100644 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.11"); + .HasAnnotation("ProductVersion", "9.0.13"); modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => { @@ -52,6 +52,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() + .HasMaxLength(1024) .HasColumnType("TEXT"); b.Property("ActivityType") @@ -335,6 +336,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() + .HasMaxLength(1024) .HasColumnType("TEXT"); b.Property("ActivityType") diff --git a/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs b/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs index 230ed4f0bd..4b4484b267 100644 --- a/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs +++ b/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs @@ -33,6 +33,7 @@ public void Configure(EntityTypeBuilder builder) builder.Property("SerializedOutputs"); builder.Property("SerializedProperties"); builder.Property("SerializedMetadata"); + builder.Property(x => x.ActivityNodeId).HasMaxLength(1024); builder.Property(x => x.Status).HasConversion(); builder.HasIndex(x => x.WorkflowInstanceId).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.WorkflowInstanceId)}"); builder.HasIndex(x => x.ActivityId).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.ActivityId)}"); @@ -144,6 +145,7 @@ public void Configure(EntityTypeBuilder builder) builder.Ignore(x => x.Payload); builder.Property("SerializedActivityState"); builder.Property("SerializedPayload"); + builder.Property(x => x.ActivityNodeId).HasMaxLength(1024); builder.HasIndex(x => x.Timestamp).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.Timestamp)}"); builder.HasIndex(x => x.Sequence).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.Sequence)}"); builder.HasIndex(x => new From 6c73d5df107ecd582bc153dd5bec330a7ff547ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 13:05:59 +0000 Subject: [PATCH 3/5] Use NVARCHAR(MAX) and equivalent unlimited column types for ActivityNodeId Update V3_6 migrations to change ActivityNodeId from fixed-length columns to unlimited types: nvarchar(max) for SQL Server, longtext for MySQL, NCLOB for Oracle. PostgreSQL (text) and SQLite (TEXT) already used unlimited types. Drop ActivityNodeId indexes on both ActivityExecutionRecords and WorkflowExecutionLogRecords tables since unlimited columns cannot be indexed. Remove HasIndex for ActivityNodeId from Configurations.cs. Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> --- .../Runtime/20251204150235_V3_6.Designer.cs | 10 +- .../Migrations/Runtime/20251204150235_V3_6.cs | 66 +++ .../Runtime/20260302123620_V3_7.Designer.cs | 512 ----------------- .../Migrations/Runtime/20260302123620_V3_7.cs | 74 --- .../RuntimeElsaDbContextModelSnapshot.cs | 14 +- .../Runtime/20251204150355_V3_6.Designer.cs | 10 +- .../Migrations/Runtime/20251204150355_V3_6.cs | 58 ++ .../Runtime/20260302124146_V3_7.Designer.cs | 494 ----------------- .../Migrations/Runtime/20260302124146_V3_7.cs | 66 --- .../RuntimeElsaDbContextModelSnapshot.cs | 12 +- .../Runtime/20251204150341_V3_6.Designer.cs | 6 - .../Migrations/Runtime/20251204150341_V3_6.cs | 22 + .../Runtime/20260302123852_V3_7.Designer.cs | 512 ----------------- .../Migrations/Runtime/20260302123852_V3_7.cs | 66 --- .../RuntimeElsaDbContextModelSnapshot.cs | 14 +- .../Runtime/20251204150326_V3_6.Designer.cs | 10 +- .../Migrations/Runtime/20251204150326_V3_6.cs | 58 ++ .../Runtime/20260302123412_V3_7.Designer.cs | 513 ------------------ .../Migrations/Runtime/20260302123412_V3_7.cs | 66 --- .../RuntimeElsaDbContextModelSnapshot.cs | 14 +- .../Runtime/20251204150006_V3_6.Designer.cs | 6 - .../Migrations/Runtime/20251204150006_V3_6.cs | 22 + .../Runtime/20260302124019_V3_7.Designer.cs | 508 ----------------- .../Migrations/Runtime/20260302124019_V3_7.cs | 28 - .../RuntimeElsaDbContextModelSnapshot.cs | 10 +- .../Modules/Runtime/Configurations.cs | 4 - 26 files changed, 244 insertions(+), 2931 deletions(-) delete mode 100644 src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs delete mode 100644 src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.Designer.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.Designer.cs index 296d154d1d..50e470af86 100644 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.Designer.cs +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.Designer.cs @@ -59,7 +59,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("varchar(255)"); + .HasColumnType("longtext"); b.Property("ActivityType") .IsRequired() @@ -120,9 +120,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -342,7 +339,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("varchar(255)"); + .HasColumnType("longtext"); b.Property("ActivityType") .IsRequired() @@ -404,9 +401,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs index 12286caeb9..270937a53b 100644 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs @@ -35,6 +35,38 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Triggers", columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true); + + migrationBuilder.DropIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords"); + + migrationBuilder.DropIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); } /// @@ -55,6 +87,40 @@ protected override void Down(MigrationBuilder migrationBuilder) oldType: "varchar(255)") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "varchar(255)", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "varchar(255)", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + column: "ActivityNodeId"); + + migrationBuilder.CreateIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + column: "ActivityNodeId"); } } } diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs deleted file mode 100644 index 175fc24536..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.Designer.cs +++ /dev/null @@ -1,512 +0,0 @@ -// -using System; -using Elsa.Persistence.EFCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20260302123620_V3_7")] - partial class V3_7 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("AggregateFaultCount") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .HasColumnType("varchar(255)"); - - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedOptions") - .HasColumnType("longtext"); - - b.Property("StimulusHash") - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId") - .IsUnique() - .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs deleted file mode 100644 index 9de5b0e2e2..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260302123620_V3_7.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime -{ - /// - public partial class V3_7 : Migration - { - private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; - - /// - public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "varchar(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "varchar(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(1024)", - oldMaxLength: 1024) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(1024)", - oldMaxLength: 1024) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 2b541f2bbe..b275ed0f24 100644 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("ProductVersion", "9.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); @@ -56,8 +56,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); + .HasColumnType("longtext"); b.Property("ActivityType") .IsRequired() @@ -118,9 +117,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -340,8 +336,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); + .HasColumnType("longtext"); b.Property("ActivityType") .IsRequired() @@ -403,9 +398,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.Designer.cs index 2397aab877..51d7900cd4 100644 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.Designer.cs +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.Designer.cs @@ -59,7 +59,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("NVARCHAR2(450)"); + .HasColumnType("NCLOB"); b.Property("ActivityType") .IsRequired() @@ -120,9 +120,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -343,7 +340,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("NVARCHAR2(450)"); + .HasColumnType("NCLOB"); b.Property("ActivityType") .IsRequired() @@ -405,9 +402,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs index d996768b38..2090dce04a 100644 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs @@ -25,6 +25,34 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true, filter: "\"Hash\" IS NOT NULL"); + + migrationBuilder.DropIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords"); + + migrationBuilder.DropIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "NCLOB", + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR2(450)"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "NCLOB", + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR2(450)"); } /// @@ -34,6 +62,36 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId_TenantId", schema: _schema.Schema, table: "Triggers"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "NVARCHAR2(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "NCLOB"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "NVARCHAR2(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "NCLOB"); + + migrationBuilder.CreateIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + column: "ActivityNodeId"); + + migrationBuilder.CreateIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + column: "ActivityNodeId"); } } } diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs deleted file mode 100644 index 16e040273f..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.Designer.cs +++ /dev/null @@ -1,494 +0,0 @@ -// -using System; -using Elsa.Persistence.EFCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20260302124146_V3_7")] - partial class V3_7 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("NVARCHAR2(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("HasBookmarks") - .HasColumnType("BOOLEAN"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedException") - .HasColumnType("NCLOB"); - - b.Property("SerializedOutputs") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedProperties") - .HasColumnType("NCLOB"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BookmarkId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedOptions") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StimulusHash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Hash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("NVARCHAR2(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("EventName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Message") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Sequence") - .HasColumnType("NUMBER(19)"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("Source") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Timestamp") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("ExpiresAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedInput") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs deleted file mode 100644 index c0623baeaf..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260302124146_V3_7.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime -{ - /// - public partial class V3_7 : Migration - { - private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; - - /// - public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "NVARCHAR2(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "NVARCHAR2(450)"); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "NVARCHAR2(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "NVARCHAR2(450)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "NVARCHAR2(450)", - nullable: false, - oldClrType: typeof(string), - oldType: "NVARCHAR2(1024)", - oldMaxLength: 1024); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "NVARCHAR2(450)", - nullable: false, - oldClrType: typeof(string), - oldType: "NVARCHAR2(1024)", - oldMaxLength: 1024); - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index de6eb18490..f6232ca3e3 100644 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -56,8 +56,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("NVARCHAR2(1024)"); + .HasColumnType("NCLOB"); b.Property("ActivityType") .IsRequired() @@ -118,9 +117,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -341,8 +337,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("NVARCHAR2(1024)"); + .HasColumnType("NCLOB"); b.Property("ActivityType") .IsRequired() @@ -404,9 +399,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.Designer.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.Designer.cs index 9783fa2506..c0a1c2b9c8 100644 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.Designer.cs +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.Designer.cs @@ -120,9 +120,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -404,9 +401,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs index bce6fbd4aa..ec0cf160b4 100644 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs @@ -24,6 +24,16 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Triggers", columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true); + + migrationBuilder.DropIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords"); + + migrationBuilder.DropIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords"); } /// @@ -33,6 +43,18 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId_TenantId", schema: _schema.Schema, table: "Triggers"); + + migrationBuilder.CreateIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + column: "ActivityNodeId"); + + migrationBuilder.CreateIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + column: "ActivityNodeId"); } } } diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs deleted file mode 100644 index d7b65a0305..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.Designer.cs +++ /dev/null @@ -1,512 +0,0 @@ -// -using System; -using Elsa.Persistence.EFCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20260302123852_V3_7")] - partial class V3_7 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("AggregateFaultCount") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .HasColumnType("text"); - - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedOptions") - .HasColumnType("text"); - - b.Property("StimulusHash") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId") - .IsUnique() - .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs deleted file mode 100644 index 962cc05095..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260302123852_V3_7.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class V3_7 : Migration - { - private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; - - /// - public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "character varying(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "character varying(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(1024)", - oldMaxLength: 1024); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(1024)", - oldMaxLength: 1024); - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index a3d86e3eb7..0a645b7c34 100644 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("ProductVersion", "9.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -56,8 +56,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); + .HasColumnType("text"); b.Property("ActivityType") .IsRequired() @@ -118,9 +117,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -340,8 +336,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); + .HasColumnType("text"); b.Property("ActivityType") .IsRequired() @@ -403,9 +398,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.Designer.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.Designer.cs index 49bb3921ab..7f4d842b9d 100644 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.Designer.cs +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.Designer.cs @@ -59,7 +59,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("nvarchar(max)"); b.Property("ActivityType") .IsRequired() @@ -120,9 +120,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -343,7 +340,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("nvarchar(max)"); b.Property("ActivityType") .IsRequired() @@ -405,9 +402,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs index e1581cfc9d..2fb4e4d6f5 100644 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs @@ -44,6 +44,34 @@ ON [{_schema.Schema}].[Triggers] columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true, filter: "[Hash] IS NOT NULL"); + + migrationBuilder.DropIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords"); + + migrationBuilder.DropIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); } /// @@ -62,6 +90,36 @@ protected override void Down(MigrationBuilder migrationBuilder) nullable: false, oldClrType: typeof(string), oldType: "nvarchar(450)"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + type: "nvarchar(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.AlterColumn( + name: "ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + type: "nvarchar(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.CreateIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + column: "ActivityNodeId"); + + migrationBuilder.CreateIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + column: "ActivityNodeId"); } } } diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs deleted file mode 100644 index 16eb194bf9..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.Designer.cs +++ /dev/null @@ -1,513 +0,0 @@ -// -using System; -using Elsa.Persistence.EFCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20260302123412_V3_7")] - partial class V3_7 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("AggregateFaultCount") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("nvarchar(450)"); - - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedOptions") - .HasColumnType("nvarchar(max)"); - - b.Property("StimulusHash") - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId", "TenantId") - .IsUnique() - .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId_TenantId") - .HasFilter("[Hash] IS NOT NULL"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs deleted file mode 100644 index 5889ef1690..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20260302123412_V3_7.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime -{ - /// - public partial class V3_7 : Migration - { - private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; - - /// - public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "nvarchar(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "nvarchar(1024)", - maxLength: 1024, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "nvarchar(450)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(1024)", - oldMaxLength: 1024); - - migrationBuilder.AlterColumn( - name: "ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "nvarchar(450)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(1024)", - oldMaxLength: 1024); - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 5b57b3b544..1330b178ed 100644 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("ProductVersion", "9.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -56,8 +56,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); + .HasColumnType("nvarchar(max)"); b.Property("ActivityType") .IsRequired() @@ -118,9 +117,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -341,8 +337,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); + .HasColumnType("nvarchar(max)"); b.Property("ActivityType") .IsRequired() @@ -404,9 +399,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.Designer.cs index da36ab4775..5c43ae2279 100644 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.Designer.cs +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.Designer.cs @@ -116,9 +116,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -400,9 +397,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs index d3246d656d..eb52c2b6e4 100644 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs @@ -24,6 +24,16 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Triggers", columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true); + + migrationBuilder.DropIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords"); + + migrationBuilder.DropIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords"); } /// @@ -33,6 +43,18 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId_TenantId", schema: _schema.Schema, table: "Triggers"); + + migrationBuilder.CreateIndex( + name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", + schema: _schema.Schema, + table: "WorkflowExecutionLogRecords", + column: "ActivityNodeId"); + + migrationBuilder.CreateIndex( + name: "IX_ActivityExecutionRecord_ActivityNodeId", + schema: _schema.Schema, + table: "ActivityExecutionRecords", + column: "ActivityNodeId"); } } } diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs deleted file mode 100644 index fb30084943..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.Designer.cs +++ /dev/null @@ -1,508 +0,0 @@ -// -using System; -using Elsa.Persistence.EFCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20260302124019_V3_7")] - partial class V3_7 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("AggregateFaultCount") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .HasColumnType("TEXT"); - - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedOptions") - .HasColumnType("TEXT"); - - b.Property("StimulusHash") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId") - .IsUnique() - .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs deleted file mode 100644 index d80e1e5d10..0000000000 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20260302124019_V3_7.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime -{ - /// - public partial class V3_7 : Migration - { - private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; - - /// - public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - } - } -} diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index fbc73ef9bb..f4cf27c720 100644 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.13"); + .HasAnnotation("ProductVersion", "9.0.11"); modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => { @@ -52,7 +52,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) .HasColumnType("TEXT"); b.Property("ActivityType") @@ -114,9 +113,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); @@ -336,7 +332,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ActivityNodeId") .IsRequired() - .HasMaxLength(1024) .HasColumnType("TEXT"); b.Property("ActivityType") @@ -399,9 +394,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ActivityName") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - b.HasIndex("ActivityType") .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); diff --git a/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs b/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs index 4b4484b267..761f9c67b5 100644 --- a/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs +++ b/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/Configurations.cs @@ -33,11 +33,9 @@ public void Configure(EntityTypeBuilder builder) builder.Property("SerializedOutputs"); builder.Property("SerializedProperties"); builder.Property("SerializedMetadata"); - builder.Property(x => x.ActivityNodeId).HasMaxLength(1024); builder.Property(x => x.Status).HasConversion(); builder.HasIndex(x => x.WorkflowInstanceId).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.WorkflowInstanceId)}"); builder.HasIndex(x => x.ActivityId).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.ActivityId)}"); - builder.HasIndex(x => x.ActivityNodeId).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.ActivityNodeId)}"); builder.HasIndex(x => x.ActivityType).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.ActivityType)}"); builder.HasIndex(x => x.ActivityTypeVersion).HasDatabaseName($"IX_{nameof(ActivityExecutionRecord)}_{nameof(ActivityExecutionRecord.ActivityTypeVersion)}"); builder.HasIndex(x => new @@ -145,7 +143,6 @@ public void Configure(EntityTypeBuilder builder) builder.Ignore(x => x.Payload); builder.Property("SerializedActivityState"); builder.Property("SerializedPayload"); - builder.Property(x => x.ActivityNodeId).HasMaxLength(1024); builder.HasIndex(x => x.Timestamp).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.Timestamp)}"); builder.HasIndex(x => x.Sequence).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.Sequence)}"); builder.HasIndex(x => new @@ -156,7 +153,6 @@ public void Configure(EntityTypeBuilder builder) builder.HasIndex(x => x.ActivityInstanceId).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.ActivityInstanceId)}"); builder.HasIndex(x => x.ParentActivityInstanceId).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.ParentActivityInstanceId)}"); builder.HasIndex(x => x.ActivityId).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.ActivityId)}"); - builder.HasIndex(x => x.ActivityNodeId).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.ActivityNodeId)}"); builder.HasIndex(x => x.ActivityType).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.ActivityType)}"); builder.HasIndex(x => x.ActivityTypeVersion).HasDatabaseName($"IX_{nameof(WorkflowExecutionLogRecord)}_{nameof(WorkflowExecutionLogRecord.ActivityTypeVersion)}"); builder.HasIndex(x => new From 18980a6003b33a7a356c24d14f9491ea9c3611ab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 14:08:16 +0000 Subject: [PATCH 4/5] Add IF EXISTS guards to DropIndex calls in V3_6 migrations for all providers Replace bare migrationBuilder.DropIndex() calls with provider-specific conditional DDL to prevent errors when indexes have already been dropped: - SQL Server: IF EXISTS (SELECT * FROM sys.indexes ...) pattern - PostgreSQL: DROP INDEX IF EXISTS (native support) - SQLite: DROP INDEX IF EXISTS (native support) - MySQL: information_schema.statistics check with PREPARE/EXECUTE - Oracle: PL/SQL BEGIN...EXCEPTION WHEN OTHERS (SQLCODE -1418) Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> --- .../Migrations/Runtime/20251204150235_V3_6.cs | 28 +++++++++++++------ .../Migrations/Runtime/20251204150355_V3_6.cs | 24 ++++++++++------ .../Migrations/Runtime/20251204150341_V3_6.cs | 12 ++------ .../Migrations/Runtime/20251204150326_V3_6.cs | 24 ++++++++++------ .../Migrations/Runtime/20251204150006_V3_6.cs | 11 ++------ 5 files changed, 57 insertions(+), 42 deletions(-) diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs index 270937a53b..cfb7e6f951 100644 --- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20251204150235_V3_6.cs @@ -36,15 +36,27 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true); - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); + var schemaFilter = _schema.Schema != null ? $"'{_schema.Schema}'" : "DATABASE()"; - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); + migrationBuilder.Sql($@" + SET @exist := (SELECT COUNT(*) FROM information_schema.statistics + WHERE table_schema = {schemaFilter} AND table_name = 'WorkflowExecutionLogRecords' + AND index_name = 'IX_WorkflowExecutionLogRecord_ActivityNodeId'); + SET @sqlstmt := IF(@exist > 0, 'DROP INDEX `IX_WorkflowExecutionLogRecord_ActivityNodeId` ON `WorkflowExecutionLogRecords`', 'SELECT 1'); + PREPARE stmt FROM @sqlstmt; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); + + migrationBuilder.Sql($@" + SET @exist := (SELECT COUNT(*) FROM information_schema.statistics + WHERE table_schema = {schemaFilter} AND table_name = 'ActivityExecutionRecords' + AND index_name = 'IX_ActivityExecutionRecord_ActivityNodeId'); + SET @sqlstmt := IF(@exist > 0, 'DROP INDEX `IX_ActivityExecutionRecord_ActivityNodeId` ON `ActivityExecutionRecords`', 'SELECT 1'); + PREPARE stmt FROM @sqlstmt; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + "); migrationBuilder.AlterColumn( name: "ActivityNodeId", diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs index 2090dce04a..ae5da73a39 100644 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs @@ -26,15 +26,23 @@ protected override void Up(MigrationBuilder migrationBuilder) unique: true, filter: "\"Hash\" IS NOT NULL"); - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); + migrationBuilder.Sql(@" + BEGIN + EXECUTE IMMEDIATE 'DROP INDEX ""IX_WorkflowExecutionLogRecord_ActivityNodeId""'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -1418 THEN RAISE; END IF; + END; + "); - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); + migrationBuilder.Sql(@" + BEGIN + EXECUTE IMMEDIATE 'DROP INDEX ""IX_ActivityExecutionRecord_ActivityNodeId""'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -1418 THEN RAISE; END IF; + END; + "); migrationBuilder.AlterColumn( name: "ActivityNodeId", diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs index ec0cf160b4..efb1be6107 100644 --- a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20251204150341_V3_6.cs @@ -25,15 +25,9 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true); - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); + var schemaPrefix = _schema.Schema != null ? $"\"{_schema.Schema}\"." : ""; + migrationBuilder.Sql($"DROP INDEX IF EXISTS {schemaPrefix}\"IX_WorkflowExecutionLogRecord_ActivityNodeId\""); + migrationBuilder.Sql($"DROP INDEX IF EXISTS {schemaPrefix}\"IX_ActivityExecutionRecord_ActivityNodeId\""); } /// diff --git a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs index 2fb4e4d6f5..58b08adb32 100644 --- a/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.SqlServer/Migrations/Runtime/20251204150326_V3_6.cs @@ -45,15 +45,23 @@ ON [{_schema.Schema}].[Triggers] unique: true, filter: "[Hash] IS NOT NULL"); - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); + migrationBuilder.Sql($@" + IF EXISTS (SELECT * FROM sys.indexes WHERE name = 'IX_WorkflowExecutionLogRecord_ActivityNodeId' + AND object_id = OBJECT_ID('{_schema.Schema}.WorkflowExecutionLogRecords')) + BEGIN + DROP INDEX [IX_WorkflowExecutionLogRecord_ActivityNodeId] + ON [{_schema.Schema}].[WorkflowExecutionLogRecords] + END + "); - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); + migrationBuilder.Sql($@" + IF EXISTS (SELECT * FROM sys.indexes WHERE name = 'IX_ActivityExecutionRecord_ActivityNodeId' + AND object_id = OBJECT_ID('{_schema.Schema}.ActivityExecutionRecords')) + BEGIN + DROP INDEX [IX_ActivityExecutionRecord_ActivityNodeId] + ON [{_schema.Schema}].[ActivityExecutionRecords] + END + "); migrationBuilder.AlterColumn( name: "ActivityNodeId", diff --git a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs index eb52c2b6e4..3d46f9498e 100644 --- a/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.Sqlite/Migrations/Runtime/20251204150006_V3_6.cs @@ -25,15 +25,8 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" }, unique: true); - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); + migrationBuilder.Sql("DROP INDEX IF EXISTS \"IX_WorkflowExecutionLogRecord_ActivityNodeId\""); + migrationBuilder.Sql("DROP INDEX IF EXISTS \"IX_ActivityExecutionRecord_ActivityNodeId\""); } /// From 452ffdbb6b5f4fe7fbd89f226e31aff93bbb7431 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 14:08:51 +0000 Subject: [PATCH 5/5] Add comment explaining Oracle error code -1418 in migration Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> --- .../Migrations/Runtime/20251204150355_V3_6.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs index ae5da73a39..beaec32bc5 100644 --- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs +++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20251204150355_V3_6.cs @@ -26,6 +26,7 @@ protected override void Up(MigrationBuilder migrationBuilder) unique: true, filter: "\"Hash\" IS NOT NULL"); + // ORA-01418: specified index does not exist migrationBuilder.Sql(@" BEGIN EXECUTE IMMEDIATE 'DROP INDEX ""IX_WorkflowExecutionLogRecord_ActivityNodeId""';