elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql
Copilot 71438596f3
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>
2026-03-02 15:24:20 +01:00
..
Extensions Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
Handlers Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
Helpers Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
Migrations Fix ActivityNodeId column truncation for deeply nested workflows (#7338) 2026-03-02 15:24:20 +01:00
Services Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
DbContextFactories.cs Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
DbContextOptionsBuilder.cs Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
Elsa.Persistence.EFCore.PostgreSql.csproj Remove unused target frameworks from EF Core persistence project files 2025-12-13 21:32:47 +01:00
FodyWeavers.xml Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
MigrationHelper.cs Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
PostgreSqlProvidersExtensions.cs Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00