From 9043af1726c1fd86964600ba6f9c77de0dbed7c1 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 16 Jan 2025 20:41:12 +0100 Subject: [PATCH 1/3] Regenerate 3_3 Runtime module migrations --- .../Elsa.Dapper.Migrations/Runtime/V3_3.cs | 2 + ...ner.cs => 20250116192733_V3_3.Designer.cs} | 8 +-- ...1124504_V3_3.cs => 20250116192733_V3_3.cs} | 66 +++---------------- .../RuntimeElsaDbContextModelSnapshot.cs | 6 +- ...ner.cs => 20250116193207_V3_3.Designer.cs} | 8 +-- ...1124811_V3_3.cs => 20250116193207_V3_3.cs} | 1 - .../RuntimeElsaDbContextModelSnapshot.cs | 6 +- ...ner.cs => 20250116192950_V3_3.Designer.cs} | 8 +-- ...1124728_V3_3.cs => 20250116192950_V3_3.cs} | 43 +++--------- .../RuntimeElsaDbContextModelSnapshot.cs | 6 +- ...ner.cs => 20250116192837_V3_3.Designer.cs} | 8 +-- ...1124643_V3_3.cs => 20250116192837_V3_3.cs} | 61 +++-------------- .../RuntimeElsaDbContextModelSnapshot.cs | 6 +- ...ner.cs => 20250116192907_V3_3.Designer.cs} | 8 +-- ...1122946_V3_3.cs => 20250116192907_V3_3.cs} | 37 +++-------- .../RuntimeElsaDbContextModelSnapshot.cs | 6 +- .../Modules/Runtime/Configurations.cs | 1 + 17 files changed, 57 insertions(+), 224 deletions(-) rename src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/{20241231124504_V3_3.Designer.cs => 20250116192733_V3_3.Designer.cs} (98%) rename src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/{20241231124504_V3_3.cs => 20250116192733_V3_3.cs} (84%) rename src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/{20241231124811_V3_3.Designer.cs => 20250116193207_V3_3.Designer.cs} (98%) rename src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/{20241231124811_V3_3.cs => 20250116193207_V3_3.cs} (99%) rename src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/{20241231124728_V3_3.Designer.cs => 20250116192950_V3_3.Designer.cs} (98%) rename src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/{20241231124728_V3_3.cs => 20250116192950_V3_3.cs} (90%) rename src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/{20241231124643_V3_3.Designer.cs => 20250116192837_V3_3.Designer.cs} (98%) rename src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/{20241231124643_V3_3.cs => 20250116192837_V3_3.cs} (85%) rename src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/{20241231122946_V3_3.Designer.cs => 20250116192907_V3_3.Designer.cs} (98%) rename src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/{20241231122946_V3_3.cs => 20250116192907_V3_3.cs} (90%) diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs index 2cbb9a16f..653346ed5 100644 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs +++ b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs @@ -20,6 +20,7 @@ public class V3_3 : Migration Alter.Table("WorkflowExecutionLogRecords").AddColumn("TenantId").AsString().Nullable(); Alter.Table("ActivityExecutionRecords").AddColumn("TenantId").AsString().Nullable(); Alter.Table("KeyValuePairs").AddColumn("TenantId").AsString().Nullable(); + Rename.Column("Key").OnTable("KeyValuePairs").To("Id"); IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") .Create @@ -56,6 +57,7 @@ public class V3_3 : Migration Delete.Column("TenantId").FromTable("WorkflowExecutionLogRecords"); Delete.Column("TenantId").FromTable("ActivityExecutionRecords"); Delete.Column("TenantId").FromTable("KeyValuePairs"); + Rename.Column("Id").OnTable("KeyValuePairs").To("Key"); IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") .Create diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20241231124504_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.Designer.cs similarity index 98% rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20241231124504_V3_3.Designer.cs rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.Designer.cs index 66b24b533..cd2cae34e 100644 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20241231124504_V3_3.Designer.cs +++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime { [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20241231124504_V3_3")] + [Migration("20250116192733_V3_3")] partial class V3_3 { /// @@ -21,7 +21,7 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); @@ -31,10 +31,6 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime b.Property("Id") .HasColumnType("varchar(255)"); - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("longtext"); diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20241231124504_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.cs similarity index 84% rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20241231124504_V3_3.cs rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.cs index ab100e254..d1dc13b38 100644 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20241231124504_V3_3.cs +++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.cs @@ -19,10 +19,11 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", + migrationBuilder.RenameColumn( + name: "Key", schema: _schema.Schema, - table: "KeyValuePairs"); + table: "KeyValuePairs", + newName: "Id"); migrationBuilder.RenameColumn( name: "BookmarkId", @@ -54,26 +55,6 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.AlterColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "varchar(255)", - nullable: false, - defaultValue: "") - .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.AddColumn( name: "TenantId", schema: _schema.Schema, @@ -98,12 +79,6 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "Id"); - migrationBuilder.CreateTable( name: "BookmarkQueueItems", schema: _schema.Schema, @@ -231,11 +206,6 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime schema: _schema.Schema, table: "Triggers"); - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs"); - migrationBuilder.DropIndex( name: "IX_SerializedKeyValuePair_TenantId", schema: _schema.Schema, @@ -266,11 +236,6 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime schema: _schema.Schema, table: "Triggers"); - migrationBuilder.DropColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs"); - migrationBuilder.DropColumn( name: "TenantId", schema: _schema.Schema, @@ -286,28 +251,17 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime schema: _schema.Schema, table: "ActivityExecutionRecords"); + migrationBuilder.RenameColumn( + name: "Id", + schema: _schema.Schema, + table: "KeyValuePairs", + newName: "Key"); + migrationBuilder.RenameColumn( name: "Id", schema: _schema.Schema, table: "Bookmarks", newName: "BookmarkId"); - - migrationBuilder.AlterColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "Key"); } } } diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 5a4d7a6af..e384a181b 100644 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); @@ -28,10 +28,6 @@ namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime b.Property("Id") .HasColumnType("varchar(255)"); - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("longtext"); diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20241231124811_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250116193207_V3_3.Designer.cs similarity index 98% rename from src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20241231124811_V3_3.Designer.cs rename to src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250116193207_V3_3.Designer.cs index f554d55de..3abc3e068 100644 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20241231124811_V3_3.Designer.cs +++ b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250116193207_V3_3.Designer.cs @@ -12,7 +12,7 @@ using Oracle.EntityFrameworkCore.Metadata; namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime { [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20241231124811_V3_3")] + [Migration("20250116193207_V3_3")] partial class V3_3 { /// @@ -21,7 +21,7 @@ namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -31,10 +31,6 @@ namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime b.Property("Id") .HasColumnType("NVARCHAR2(450)"); - b.Property("Key") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("NVARCHAR2(2000)"); diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20241231124811_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250116193207_V3_3.cs similarity index 99% rename from src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20241231124811_V3_3.cs rename to src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250116193207_V3_3.cs index 435afcca0..a026586c5 100644 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20241231124811_V3_3.cs +++ b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250116193207_V3_3.cs @@ -99,7 +99,6 @@ namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime columns: table => new { Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - Key = table.Column(type: "NVARCHAR2(2000)", nullable: false), SerializedValue = table.Column(type: "NVARCHAR2(2000)", nullable: false), TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) }, diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 41ef0f940..5e1520286 100644 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -28,10 +28,6 @@ namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime b.Property("Id") .HasColumnType("NVARCHAR2(450)"); - b.Property("Key") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("NVARCHAR2(2000)"); diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20241231124728_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.Designer.cs similarity index 98% rename from src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20241231124728_V3_3.Designer.cs rename to src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.Designer.cs index c86657426..05fe77430 100644 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20241231124728_V3_3.Designer.cs +++ b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime { [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20241231124728_V3_3")] + [Migration("20250116192950_V3_3")] partial class V3_3 { /// @@ -21,7 +21,7 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -31,10 +31,6 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime b.Property("Id") .HasColumnType("text"); - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("text"); diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20241231124728_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.cs similarity index 90% rename from src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20241231124728_V3_3.cs rename to src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.cs index 9f8654a83..f9b793865 100644 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20241231124728_V3_3.cs +++ b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.cs @@ -19,10 +19,11 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", + migrationBuilder.RenameColumn( + name: "Key", schema: _schema.Schema, - table: "KeyValuePairs"); + table: "KeyValuePairs", + newName: "Id"); migrationBuilder.RenameColumn( name: "BookmarkId", @@ -51,14 +52,6 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime type: "text", nullable: true); - migrationBuilder.AddColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "text", - nullable: false, - defaultValue: ""); - migrationBuilder.AddColumn( name: "TenantId", schema: _schema.Schema, @@ -80,12 +73,6 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime type: "text", nullable: true); - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "Id"); - migrationBuilder.CreateTable( name: "BookmarkQueueItems", schema: _schema.Schema, @@ -203,11 +190,6 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime schema: _schema.Schema, table: "Triggers"); - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs"); - migrationBuilder.DropIndex( name: "IX_SerializedKeyValuePair_TenantId", schema: _schema.Schema, @@ -238,11 +220,6 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime schema: _schema.Schema, table: "Triggers"); - migrationBuilder.DropColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs"); - migrationBuilder.DropColumn( name: "TenantId", schema: _schema.Schema, @@ -258,17 +235,17 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime schema: _schema.Schema, table: "ActivityExecutionRecords"); + migrationBuilder.RenameColumn( + name: "Id", + schema: _schema.Schema, + table: "KeyValuePairs", + newName: "Key"); + migrationBuilder.RenameColumn( name: "Id", schema: _schema.Schema, table: "Bookmarks", newName: "BookmarkId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "Key"); } } } diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 643dc2474..01066d7e1 100644 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -28,10 +28,6 @@ namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime b.Property("Id") .HasColumnType("text"); - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("text"); diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20241231124643_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.Designer.cs similarity index 98% rename from src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20241231124643_V3_3.Designer.cs rename to src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.Designer.cs index fdc1b9e23..6f59df17b 100644 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20241231124643_V3_3.Designer.cs +++ b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime { [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20241231124643_V3_3")] + [Migration("20250116192837_V3_3")] partial class V3_3 { /// @@ -21,7 +21,7 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -31,10 +31,6 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime b.Property("Id") .HasColumnType("nvarchar(450)"); - b.Property("Key") - .IsRequired() - .HasColumnType("nvarchar(max)"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("nvarchar(max)"); diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20241231124643_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.cs similarity index 85% rename from src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20241231124643_V3_3.cs rename to src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.cs index c8a162b3e..ea7495e61 100644 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20241231124643_V3_3.cs +++ b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.cs @@ -19,10 +19,11 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", + migrationBuilder.RenameColumn( + name: "Key", schema: _schema.Schema, - table: "KeyValuePairs"); + table: "KeyValuePairs", + newName: "Id"); migrationBuilder.RenameColumn( name: "BookmarkId", @@ -51,23 +52,6 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime type: "nvarchar(450)", nullable: true); - migrationBuilder.AlterColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - - migrationBuilder.AddColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "nvarchar(450)", - nullable: false, - defaultValue: ""); - migrationBuilder.AddColumn( name: "TenantId", schema: _schema.Schema, @@ -89,12 +73,6 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime type: "nvarchar(450)", nullable: true); - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "Id"); - migrationBuilder.CreateTable( name: "BookmarkQueueItems", schema: _schema.Schema, @@ -212,11 +190,6 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime schema: _schema.Schema, table: "Triggers"); - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs"); - migrationBuilder.DropIndex( name: "IX_SerializedKeyValuePair_TenantId", schema: _schema.Schema, @@ -247,11 +220,6 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime schema: _schema.Schema, table: "Triggers"); - migrationBuilder.DropColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs"); - migrationBuilder.DropColumn( name: "TenantId", schema: _schema.Schema, @@ -267,26 +235,17 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime schema: _schema.Schema, table: "ActivityExecutionRecords"); + migrationBuilder.RenameColumn( + name: "Id", + schema: _schema.Schema, + table: "KeyValuePairs", + newName: "Key"); + migrationBuilder.RenameColumn( name: "Id", schema: _schema.Schema, table: "Bookmarks", newName: "BookmarkId"); - - migrationBuilder.AlterColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "nvarchar(450)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "Key"); } } } diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 663fb6f45..2d936a1c8 100644 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -28,10 +28,6 @@ namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime b.Property("Id") .HasColumnType("nvarchar(450)"); - b.Property("Key") - .IsRequired() - .HasColumnType("nvarchar(max)"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("nvarchar(max)"); diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20241231122946_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.Designer.cs similarity index 98% rename from src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20241231122946_V3_3.Designer.cs rename to src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.Designer.cs index 904170343..d92a8513f 100644 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20241231122946_V3_3.Designer.cs +++ b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.Designer.cs @@ -11,24 +11,20 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime { [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20241231122946_V3_3")] + [Migration("20250116192907_V3_3")] partial class V3_3 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "9.0.0"); + modelBuilder.HasAnnotation("ProductVersion", "8.0.11"); modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => { b.Property("Id") .HasColumnType("TEXT"); - b.Property("Key") - .IsRequired() - .HasColumnType("TEXT"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("TEXT"); diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20241231122946_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.cs similarity index 90% rename from src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20241231122946_V3_3.cs rename to src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.cs index 4490f83bd..4316a2459 100644 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20241231122946_V3_3.cs +++ b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.cs @@ -19,9 +19,10 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", - table: "KeyValuePairs"); + migrationBuilder.RenameColumn( + name: "Key", + table: "KeyValuePairs", + newName: "Id"); migrationBuilder.RenameColumn( name: "BookmarkId", @@ -46,13 +47,6 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime type: "TEXT", nullable: true); - migrationBuilder.AddColumn( - name: "Id", - table: "KeyValuePairs", - type: "TEXT", - nullable: false, - defaultValue: ""); - migrationBuilder.AddColumn( name: "TenantId", table: "KeyValuePairs", @@ -71,11 +65,6 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime type: "TEXT", nullable: true); - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - table: "KeyValuePairs", - column: "Id"); - migrationBuilder.CreateTable( name: "BookmarkQueueItems", columns: table => new @@ -176,10 +165,6 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime name: "IX_StoredTrigger_TenantId", table: "Triggers"); - migrationBuilder.DropPrimaryKey( - name: "PK_KeyValuePairs", - table: "KeyValuePairs"); - migrationBuilder.DropIndex( name: "IX_SerializedKeyValuePair_TenantId", table: "KeyValuePairs"); @@ -204,10 +189,6 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime name: "TenantId", table: "Triggers"); - migrationBuilder.DropColumn( - name: "Id", - table: "KeyValuePairs"); - migrationBuilder.DropColumn( name: "TenantId", table: "KeyValuePairs"); @@ -220,15 +201,15 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime name: "TenantId", table: "ActivityExecutionRecords"); + migrationBuilder.RenameColumn( + name: "Id", + table: "KeyValuePairs", + newName: "Key"); + migrationBuilder.RenameColumn( name: "Id", table: "Bookmarks", newName: "BookmarkId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_KeyValuePairs", - table: "KeyValuePairs", - column: "Key"); } } } diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs index 21a5c53c9..de19a039a 100644 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs @@ -15,17 +15,13 @@ namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "9.0.0"); + modelBuilder.HasAnnotation("ProductVersion", "8.0.11"); modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => { b.Property("Id") .HasColumnType("TEXT"); - b.Property("Key") - .IsRequired() - .HasColumnType("TEXT"); - b.Property("SerializedValue") .IsRequired() .HasColumnType("TEXT"); diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/Configurations.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/Configurations.cs index 1e097aefa..140e84dab 100644 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/Configurations.cs +++ b/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/Configurations.cs @@ -68,6 +68,7 @@ public class Configurations : public void Configure(EntityTypeBuilder builder) { builder.HasKey(x => x.Id); + builder.Ignore(x => x.Key); builder.HasIndex(x => x.TenantId, $"IX_{nameof(SerializedKeyValuePair)}_{nameof(SerializedKeyValuePair.TenantId)}"); } From 93aa3a7835fa4c9d9972420e018434c8af0ef309 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 17 Jan 2025 08:56:21 +0100 Subject: [PATCH 2/3] Remove WorkflowInboxMessages table and associated logic. This change eliminates the previously defined WorkflowInboxMessages table and its creation logic for all databases. Cleanup simplifies the database schema and maintains focus on essential entities. --- .../Elsa.Dapper.Migrations/Runtime/V3_3.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs index 653346ed5..8c91daf2b 100644 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs +++ b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs @@ -14,7 +14,6 @@ public class V3_3 : Migration /// public override void Up() { - Delete.Table("WorkflowInboxMessages"); Alter.Table("Triggers").AddColumn("TenantId").AsString().Nullable(); Alter.Table("Bookmarks").AddColumn("TenantId").AsString().Nullable(); Alter.Table("WorkflowExecutionLogRecords").AddColumn("TenantId").AsString().Nullable(); @@ -74,21 +73,6 @@ public class V3_3 : Migration .WithColumn("ExpiresAt").AsDateTimeOffset().Indexed() ; - IfDatabase("Sqlite") - .Create - .Table("WorkflowInboxMessages") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ActivityTypeName").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().Nullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().Nullable().Indexed() - .WithColumn("CorrelationId").AsString().Nullable().Indexed() - .WithColumn("Hash").AsString().NotNullable().Indexed() - .WithColumn("SerializedBookmarkPayload").AsString(MaxValue) - .WithColumn("SerializedInput").AsString(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTime2().Indexed() - .WithColumn("ExpiresAt").AsDateTime2().Indexed() - ; - Delete.Table("BookmarkQueueItems"); } } \ No newline at end of file From 35d21a69ed7070254c4642456753ddeaa8d029ab Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 17 Jan 2025 08:57:22 +0100 Subject: [PATCH 3/3] Remove creation of WorkflowInboxMessages table. This commit deletes the code responsible for creating the WorkflowInboxMessages table. The change simplifies the migration script by removing unused or unnecessary table definitions and ensures consistency in database schema evolution. --- .../Elsa.Dapper.Migrations/Runtime/V3_3.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs index 8c91daf2b..bbe82ae9f 100644 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs +++ b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs @@ -57,22 +57,6 @@ public class V3_3 : Migration Delete.Column("TenantId").FromTable("ActivityExecutionRecords"); Delete.Column("TenantId").FromTable("KeyValuePairs"); Rename.Column("Id").OnTable("KeyValuePairs").To("Key"); - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("WorkflowInboxMessages") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ActivityTypeName").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().Nullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().Nullable().Indexed() - .WithColumn("CorrelationId").AsString().Nullable().Indexed() - .WithColumn("Hash").AsString().NotNullable().Indexed() - .WithColumn("SerializedBookmarkPayload").AsString(MaxValue) - .WithColumn("SerializedInput").AsString(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTimeOffset().Indexed() - .WithColumn("ExpiresAt").AsDateTimeOffset().Indexed() - ; - Delete.Table("BookmarkQueueItems"); } } \ No newline at end of file