Fix ActivityNodeId column truncation for deeply nested workflows (#7338)
* Initial plan * 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> * 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> * 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> * Add comment explaining Oracle error code -1418 in migration Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
This commit is contained in:
parent
6f53c26f24
commit
71438596f3
|
|
@ -59,7 +59,7 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -120,9 +120,6 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
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 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -404,9 +401,6 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,50 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
table: "Triggers",
|
||||
columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" },
|
||||
unique: true);
|
||||
|
||||
var schemaFilter = _schema.Schema != null ? $"'{_schema.Schema}'" : "DATABASE()";
|
||||
|
||||
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<string>(
|
||||
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<string>(
|
||||
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");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -55,6 +99,40 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
oldType: "varchar(255)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
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<string>(
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -117,9 +117,6 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
|
||||
|
||||
|
|
@ -339,7 +336,7 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -401,9 +398,6 @@ namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("NVARCHAR2(450)");
|
||||
.HasColumnType("NCLOB");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -120,9 +120,6 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
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 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("NVARCHAR2(450)");
|
||||
.HasColumnType("NCLOB");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -405,9 +402,6 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,43 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" },
|
||||
unique: true,
|
||||
filter: "\"Hash\" IS NOT NULL");
|
||||
|
||||
// ORA-01418: specified index does not exist
|
||||
migrationBuilder.Sql(@"
|
||||
BEGIN
|
||||
EXECUTE IMMEDIATE 'DROP INDEX ""IX_WorkflowExecutionLogRecord_ActivityNodeId""';
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
IF SQLCODE != -1418 THEN RAISE; END IF;
|
||||
END;
|
||||
");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
BEGIN
|
||||
EXECUTE IMMEDIATE 'DROP INDEX ""IX_ActivityExecutionRecord_ActivityNodeId""';
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
IF SQLCODE != -1418 THEN RAISE; END IF;
|
||||
END;
|
||||
");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ActivityNodeId",
|
||||
schema: _schema.Schema,
|
||||
table: "WorkflowExecutionLogRecords",
|
||||
type: "NCLOB",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "NVARCHAR2(450)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ActivityNodeId",
|
||||
schema: _schema.Schema,
|
||||
table: "ActivityExecutionRecords",
|
||||
type: "NCLOB",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "NVARCHAR2(450)");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -34,6 +71,36 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
name: "IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId_TenantId",
|
||||
schema: _schema.Schema,
|
||||
table: "Triggers");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ActivityNodeId",
|
||||
schema: _schema.Schema,
|
||||
table: "WorkflowExecutionLogRecords",
|
||||
type: "NVARCHAR2(450)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "NCLOB");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("NVARCHAR2(450)");
|
||||
.HasColumnType("NCLOB");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -117,9 +117,6 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
|
||||
|
||||
|
|
@ -340,7 +337,7 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("NVARCHAR2(450)");
|
||||
.HasColumnType("NCLOB");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -402,9 +399,6 @@ namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -120,9 +120,6 @@ namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
|
|||
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 @@ namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
|
|||
table: "Triggers",
|
||||
columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" },
|
||||
unique: true);
|
||||
|
||||
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\"");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -33,6 +37,18 @@ namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
|
|||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,9 +117,6 @@ namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
|
||||
|
||||
|
|
@ -401,9 +398,6 @@ namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -120,9 +120,6 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
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 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -405,9 +402,6 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,42 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" },
|
||||
unique: true,
|
||||
filter: "[Hash] IS NOT NULL");
|
||||
|
||||
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.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<string>(
|
||||
name: "ActivityNodeId",
|
||||
schema: _schema.Schema,
|
||||
table: "WorkflowExecutionLogRecords",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ActivityNodeId",
|
||||
schema: _schema.Schema,
|
||||
table: "ActivityExecutionRecords",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -62,6 +98,36 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ActivityNodeId",
|
||||
schema: _schema.Schema,
|
||||
table: "WorkflowExecutionLogRecords",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -117,9 +117,6 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
|
||||
|
||||
|
|
@ -340,7 +337,7 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
|
||||
b.Property<string>("ActivityNodeId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ActivityType")
|
||||
.IsRequired()
|
||||
|
|
@ -402,9 +399,6 @@ namespace Elsa.Persistence.EFCore.SqlServer.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -116,9 +116,6 @@ namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime
|
|||
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 @@ namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime
|
|||
table: "Triggers",
|
||||
columns: new[] { "WorkflowDefinitionId", "Hash", "ActivityId", "TenantId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.Sql("DROP INDEX IF EXISTS \"IX_WorkflowExecutionLogRecord_ActivityNodeId\"");
|
||||
migrationBuilder.Sql("DROP INDEX IF EXISTS \"IX_ActivityExecutionRecord_ActivityNodeId\"");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -33,6 +36,18 @@ namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime
|
|||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,9 +113,6 @@ namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
|
||||
|
||||
|
|
@ -397,9 +394,6 @@ namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime
|
|||
b.HasIndex("ActivityName")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
|
||||
|
||||
b.HasIndex("ActivityNodeId")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
|
||||
|
||||
b.HasIndex("ActivityType")
|
||||
.HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ public class Configurations :
|
|||
builder.Property(x => x.Status).HasConversion<string>();
|
||||
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
|
||||
|
|
@ -154,7 +153,6 @@ public class Configurations :
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue