diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241026094453_V3_3.Designer.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241023123010_V3_3.Designer.cs
similarity index 99%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241026094453_V3_3.Designer.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241023123010_V3_3.Designer.cs
index 0fc0aab255..285452d06c 100644
--- a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241026094453_V3_3.Designer.cs
+++ b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241023123010_V3_3.Designer.cs
@@ -10,7 +10,7 @@
namespace Elsa.Agents.Persistence.EntityFrameworkCore.MySql.Migrations
{
[DbContext(typeof(AgentsDbContext))]
- [Migration("20241026094453_V3_3")]
+ [Migration("20241023123010_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241026094453_V3_3.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241023123010_V3_3.cs
similarity index 100%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241026094453_V3_3.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.MySql/Migrations/20241023123010_V3_3.cs
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241026094528_V3_3.Designer.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241023122148_V3_3.Designer.cs
similarity index 99%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241026094528_V3_3.Designer.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241023122148_V3_3.Designer.cs
index 1779b2944e..e6c43e0a0e 100644
--- a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241026094528_V3_3.Designer.cs
+++ b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241023122148_V3_3.Designer.cs
@@ -11,7 +11,7 @@
namespace Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql.Migrations
{
[DbContext(typeof(AgentsDbContext))]
- [Migration("20241026094528_V3_3")]
+ [Migration("20241023122148_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241026094528_V3_3.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241023122148_V3_3.cs
similarity index 100%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241026094528_V3_3.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/Migrations/20241023122148_V3_3.cs
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241026094613_V3_3.Designer.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241023123153_V3_3.Designer.cs
similarity index 99%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241026094613_V3_3.Designer.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241023123153_V3_3.Designer.cs
index 91693675ec..c571b21aaa 100644
--- a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241026094613_V3_3.Designer.cs
+++ b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241023123153_V3_3.Designer.cs
@@ -11,7 +11,7 @@
namespace Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer.Migrations
{
[DbContext(typeof(AgentsDbContext))]
- [Migration("20241026094613_V3_3")]
+ [Migration("20241023123153_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241026094613_V3_3.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241023123153_V3_3.cs
similarity index 100%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241026094613_V3_3.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.SqlServer/Migrations/20241023123153_V3_3.cs
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241026094553_V3_3.Designer.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241023123129_V3_3.Designer.cs
similarity index 98%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241026094553_V3_3.Designer.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241023123129_V3_3.Designer.cs
index 606aacc858..5a4e3bc347 100644
--- a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241026094553_V3_3.Designer.cs
+++ b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241023123129_V3_3.Designer.cs
@@ -10,7 +10,7 @@
namespace Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite.Migrations
{
[DbContext(typeof(AgentsDbContext))]
- [Migration("20241026094553_V3_3")]
+ [Migration("20241023123129_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241026094553_V3_3.cs b/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241023123129_V3_3.cs
similarity index 100%
rename from src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241026094553_V3_3.cs
rename to src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.Sqlite/Migrations/20241023123129_V3_3.cs
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.Designer.cs
new file mode 100644
index 0000000000..9dcb708d85
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.Designer.cs
@@ -0,0 +1,119 @@
+//
+using System;
+using Elsa.EntityFrameworkCore.Modules.Alterations;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
+{
+ [DbContext(typeof(AlterationsElsaDbContext))]
+ [Migration("20231015122151_Initial")]
+ partial class Initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("PlanId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedLog")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_AlterationJob_CompletedAt");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_AlterationJob_CreatedAt");
+
+ b.HasIndex("PlanId")
+ .HasDatabaseName("IX_AlterationJob_PlanId");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_AlterationJob_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_AlterationJob_Status");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId");
+
+ b.ToTable("AlterationJobs", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("SerializedAlterations")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedWorkflowInstanceIds")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_AlterationPlan_CompletedAt");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_AlterationPlan_CreatedAt");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_AlterationPlan_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_AlterationPlan_Status");
+
+ b.ToTable("AlterationPlans", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241026094641_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.cs
similarity index 78%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241026094641_V3_3.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.cs
index 2d02d01a20..09c731fb33 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241026094641_V3_3.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.cs
@@ -1,26 +1,22 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
{
///
- public partial class V3_3 : Migration
+ public partial class Initial : Migration
{
- private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema;
-
- ///
- public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema)
+ private readonly IElsaDbContextSchema _schema;
+ public Initial(IElsaDbContextSchema schema)
{
- _schema = schema;
+ _schema = schema ?? throw new ArgumentNullException(nameof(schema));
}
-
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
- name: "Elsa");
+ name: _schema.Schema);
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
@@ -36,14 +32,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
.Annotation("MySql:CharSet", "utf8mb4"),
WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
- Status = table.Column(type: "varchar(255)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
+ Status = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime(6)", nullable: false),
StartedAt = table.Column(type: "datetime(6)", nullable: true),
CompletedAt = table.Column(type: "datetime(6)", nullable: true),
SerializedLog = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -59,16 +52,13 @@ protected override void Up(MigrationBuilder migrationBuilder)
{
Id = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
- Status = table.Column(type: "varchar(255)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
+ Status = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime(6)", nullable: false),
StartedAt = table.Column(type: "datetime(6)", nullable: true),
CompletedAt = table.Column(type: "datetime(6)", nullable: true),
SerializedAlterations = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
- SerializedWorkflowInstanceFilter = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
+ SerializedWorkflowInstanceIds = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -107,12 +97,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "AlterationJobs",
column: "Status");
- migrationBuilder.CreateIndex(
- name: "IX_AlterationJob_TenantId",
- schema: _schema.Schema,
- table: "AlterationJobs",
- column: "TenantId");
-
migrationBuilder.CreateIndex(
name: "IX_AlterationJob_WorkflowInstanceId",
schema: _schema.Schema,
@@ -142,12 +126,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
schema: _schema.Schema,
table: "AlterationPlans",
column: "Status");
-
- migrationBuilder.CreateIndex(
- name: "IX_AlterationPlan_TenantId",
- schema: _schema.Schema,
- table: "AlterationPlans",
- column: "TenantId");
}
///
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.Designer.cs
new file mode 100644
index 0000000000..df3478e064
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.Designer.cs
@@ -0,0 +1,121 @@
+//
+using System;
+using Elsa.EntityFrameworkCore.Modules.Alterations;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
+{
+ [DbContext(typeof(AlterationsElsaDbContext))]
+ [Migration("20240329200618_V3_1")]
+ partial class V3_1
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.14")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("PlanId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedLog")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_AlterationJob_CompletedAt");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_AlterationJob_CreatedAt");
+
+ b.HasIndex("PlanId")
+ .HasDatabaseName("IX_AlterationJob_PlanId");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_AlterationJob_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_AlterationJob_Status");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId");
+
+ b.ToTable("AlterationJobs", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("SerializedAlterations")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedWorkflowInstanceFilter")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_AlterationPlan_CompletedAt");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_AlterationPlan_CreatedAt");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_AlterationPlan_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_AlterationPlan_Status");
+
+ b.ToTable("AlterationPlans", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.cs
new file mode 100644
index 0000000000..56b1865c06
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.cs
@@ -0,0 +1,78 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
+{
+ ///
+ public partial class V3_1 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_1(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.RenameColumn(
+ name: "SerializedWorkflowInstanceIds",
+ schema: _schema.Schema,
+ table: "AlterationPlans",
+ newName: "SerializedWorkflowInstanceFilter");
+
+ migrationBuilder.AlterColumn(
+ name: "Status",
+ schema: _schema.Schema,
+ table: "AlterationPlans",
+ type: "varchar(255)",
+ nullable: false,
+ oldClrType: typeof(int),
+ oldType: "int")
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "Status",
+ schema: _schema.Schema,
+ table: "AlterationJobs",
+ type: "varchar(255)",
+ nullable: false,
+ oldClrType: typeof(int),
+ oldType: "int")
+ .Annotation("MySql:CharSet", "utf8mb4");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.RenameColumn(
+ name: "SerializedWorkflowInstanceFilter",
+ schema: _schema.Schema,
+ table: "AlterationPlans",
+ newName: "SerializedWorkflowInstanceIds");
+
+ migrationBuilder.AlterColumn(
+ name: "Status",
+ schema: _schema.Schema,
+ table: "AlterationPlans",
+ type: "int",
+ nullable: false,
+ oldClrType: typeof(string),
+ oldType: "varchar(255)")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "Status",
+ schema: _schema.Schema,
+ table: "AlterationJobs",
+ type: "int",
+ nullable: false,
+ oldClrType: typeof(string),
+ oldType: "varchar(255)")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.Designer.cs
new file mode 100644
index 0000000000..ed6e592156
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.Designer.cs
@@ -0,0 +1,121 @@
+//
+using System;
+using Elsa.EntityFrameworkCore.Modules.Alterations;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
+{
+ [DbContext(typeof(AlterationsElsaDbContext))]
+ [Migration("20240610184517_V3_2")]
+ partial class V3_2
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.20")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("PlanId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedLog")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_AlterationJob_CompletedAt");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_AlterationJob_CreatedAt");
+
+ b.HasIndex("PlanId")
+ .HasDatabaseName("IX_AlterationJob_PlanId");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_AlterationJob_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_AlterationJob_Status");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId");
+
+ b.ToTable("AlterationJobs", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("SerializedAlterations")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedWorkflowInstanceFilter")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_AlterationPlan_CompletedAt");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_AlterationPlan_CreatedAt");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_AlterationPlan_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_AlterationPlan_Status");
+
+ b.ToTable("AlterationPlans", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.cs
new file mode 100644
index 0000000000..ca400108fe
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
+{
+ ///
+ public partial class V3_2 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_2(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241026094641_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240715192955_V3_3.Designer.cs
similarity index 99%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241026094641_V3_3.Designer.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240715192955_V3_3.Designer.cs
index 0b5f2aa6be..067a5bd08d 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241026094641_V3_3.Designer.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240715192955_V3_3.Designer.cs
@@ -11,7 +11,7 @@
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
{
[DbContext(typeof(AlterationsElsaDbContext))]
- [Migration("20241026094641_V3_3")]
+ [Migration("20240715192955_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240715192955_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240715192955_V3_3.cs
new file mode 100644
index 0000000000..a2539bdb45
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240715192955_V3_3.cs
@@ -0,0 +1,74 @@
+#nullable disable
+
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations
+{
+ ///
+ public partial class V3_3 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_3(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "AlterationPlans",
+ type: "varchar(255)",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "AlterationJobs",
+ type: "varchar(255)",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AlterationPlan_TenantId",
+ schema: _schema.Schema,
+ table: "AlterationPlans",
+ column: "TenantId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AlterationJob_TenantId",
+ schema: _schema.Schema,
+ table: "AlterationJobs",
+ column: "TenantId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "IX_AlterationPlan_TenantId",
+ schema: _schema.Schema,
+ table: "AlterationPlans");
+
+ migrationBuilder.DropIndex(
+ name: "IX_AlterationJob_TenantId",
+ schema: _schema.Schema,
+ table: "AlterationJobs");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "AlterationPlans");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "AlterationJobs");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.Designer.cs
new file mode 100644
index 0000000000..aa2f7e6300
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.Designer.cs
@@ -0,0 +1,128 @@
+//
+using Elsa.EntityFrameworkCore.Modules.Identity;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
+{
+ [DbContext(typeof(IdentityElsaDbContext))]
+ [Migration("20231015122238_Initial")]
+ partial class Initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Identity.Entities.Application", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("HashedApiKey")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedApiKeySalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedClientSecret")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedClientSecretSalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Roles")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Roles");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId")
+ .IsUnique()
+ .HasDatabaseName("IX_Application_ClientId");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_Application_Name");
+
+ b.ToTable("Applications", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Identity.Entities.Role", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Permissions")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Permissions");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_Role_Name");
+
+ b.ToTable("Roles", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Identity.Entities.User", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("HashedPassword")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedPasswordSalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Roles")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Roles");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_User_Name");
+
+ b.ToTable("Users", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241026094829_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.cs
similarity index 79%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241026094829_V3_3.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.cs
index 2af5be9903..69da23b236 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241026094829_V3_3.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.cs
@@ -1,25 +1,22 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
{
///
- public partial class V3_3 : Migration
+ public partial class Initial : Migration
{
- private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema;
-
- ///
- public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema)
+ private readonly IElsaDbContextSchema _schema;
+ public Initial(IElsaDbContextSchema schema)
{
- _schema = schema;
+ _schema = schema ?? throw new ArgumentNullException(nameof(schema));
}
-
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
- name: "Elsa");
+ name: _schema.Schema);
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
@@ -44,8 +41,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
HashedApiKeySalt = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Roles = table.Column(type: "longtext", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -64,8 +59,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
Name = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Permissions = table.Column(type: "longtext", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -88,8 +81,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
HashedPasswordSalt = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Roles = table.Column(type: "longtext", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -112,12 +103,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "Name",
unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_Application_TenantId",
- schema: _schema.Schema,
- table: "Applications",
- column: "TenantId");
-
migrationBuilder.CreateIndex(
name: "IX_Role_Name",
schema: _schema.Schema,
@@ -125,24 +110,12 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "Name",
unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_Role_TenantId",
- schema: _schema.Schema,
- table: "Roles",
- column: "TenantId");
-
migrationBuilder.CreateIndex(
name: "IX_User_Name",
schema: _schema.Schema,
table: "Users",
column: "Name",
unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_User_TenantId",
- schema: _schema.Schema,
- table: "Users",
- column: "TenantId");
}
///
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.Designer.cs
new file mode 100644
index 0000000000..faaf237893
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.Designer.cs
@@ -0,0 +1,128 @@
+//
+using Elsa.EntityFrameworkCore.Modules.Identity;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
+{
+ [DbContext(typeof(IdentityElsaDbContext))]
+ [Migration("20240329200746_V3_1")]
+ partial class V3_1
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.14")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Identity.Entities.Application", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("HashedApiKey")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedApiKeySalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedClientSecret")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedClientSecretSalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Roles")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Roles");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId")
+ .IsUnique()
+ .HasDatabaseName("IX_Application_ClientId");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_Application_Name");
+
+ b.ToTable("Applications", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Identity.Entities.Role", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Permissions")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Permissions");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_Role_Name");
+
+ b.ToTable("Roles", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Identity.Entities.User", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("HashedPassword")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedPasswordSalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Roles")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Roles");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_User_Name");
+
+ b.ToTable("Users", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.cs
new file mode 100644
index 0000000000..36999aa945
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
+{
+ ///
+ public partial class V3_1 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_1(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.Designer.cs
new file mode 100644
index 0000000000..e25e181018
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.Designer.cs
@@ -0,0 +1,128 @@
+//
+using Elsa.EntityFrameworkCore.Modules.Identity;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
+{
+ [DbContext(typeof(IdentityElsaDbContext))]
+ [Migration("20240610184903_V3_2")]
+ partial class V3_2
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.20")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Identity.Entities.Application", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("HashedApiKey")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedApiKeySalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedClientSecret")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedClientSecretSalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Roles")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Roles");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId")
+ .IsUnique()
+ .HasDatabaseName("IX_Application_ClientId");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_Application_Name");
+
+ b.ToTable("Applications", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Identity.Entities.Role", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Permissions")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Permissions");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_Role_Name");
+
+ b.ToTable("Roles", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Identity.Entities.User", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("HashedPassword")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("HashedPasswordSalt")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Roles")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("Roles");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_User_Name");
+
+ b.ToTable("Users", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.cs
new file mode 100644
index 0000000000..d514c417fb
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
+{
+ ///
+ public partial class V3_2 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_2(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241026094829_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240715193513_V3_3.Designer.cs
similarity index 99%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241026094829_V3_3.Designer.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240715193513_V3_3.Designer.cs
index 270d5ec66f..0cad7b4fc0 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241026094829_V3_3.Designer.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240715193513_V3_3.Designer.cs
@@ -10,7 +10,7 @@
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
{
[DbContext(typeof(IdentityElsaDbContext))]
- [Migration("20241026094829_V3_3")]
+ [Migration("20240715193513_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240715193513_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240715193513_V3_3.cs
new file mode 100644
index 0000000000..a81f899216
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240715193513_V3_3.cs
@@ -0,0 +1,98 @@
+#nullable disable
+
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity
+{
+ ///
+ public partial class V3_3 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_3(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Users",
+ type: "varchar(255)",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Roles",
+ type: "varchar(255)",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Applications",
+ type: "varchar(255)",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_User_TenantId",
+ schema: _schema.Schema,
+ table: "Users",
+ column: "TenantId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Role_TenantId",
+ schema: _schema.Schema,
+ table: "Roles",
+ column: "TenantId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Application_TenantId",
+ schema: _schema.Schema,
+ table: "Applications",
+ column: "TenantId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "IX_User_TenantId",
+ schema: _schema.Schema,
+ table: "Users");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Role_TenantId",
+ schema: _schema.Schema,
+ table: "Roles");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Application_TenantId",
+ schema: _schema.Schema,
+ table: "Applications");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Users");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Roles");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Applications");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.Designer.cs
new file mode 100644
index 0000000000..a644c444cd
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.Designer.cs
@@ -0,0 +1,82 @@
+//
+using Elsa.EntityFrameworkCore.Modules.Labels;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
+{
+ [DbContext(typeof(LabelsElsaDbContext))]
+ [Migration("20231015122253_Initial")]
+ partial class Initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Labels.Entities.Label", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Color")
+ .HasColumnType("longtext");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("Id");
+
+ b.ToTable("Labels", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("LabelId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LabelId")
+ .HasDatabaseName("WorkflowDefinitionLabel_LabelId");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId");
+
+ b.ToTable("WorkflowDefinitionLabels", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241026094901_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.cs
similarity index 81%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241026094901_V3_3.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.cs
index c61d3e0f10..16cb06abfb 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241026094901_V3_3.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.cs
@@ -1,25 +1,22 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
{
///
- public partial class V3_3 : Migration
+ public partial class Initial : Migration
{
- private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema;
-
- ///
- public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema)
+ private readonly IElsaDbContextSchema _schema;
+ public Initial(IElsaDbContextSchema schema)
{
- _schema = schema;
+ _schema = schema ?? throw new ArgumentNullException(nameof(schema));
}
-
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
- name: "Elsa");
+ name: _schema.Schema);
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
@@ -38,8 +35,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
Description = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Color = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -60,8 +55,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
WorkflowDefinitionVersionId = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LabelId = table.Column(type: "varchar(255)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -76,12 +69,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "WorkflowDefinitionLabels",
column: "LabelId");
- migrationBuilder.CreateIndex(
- name: "WorkflowDefinitionLabel_TenantId",
- schema: _schema.Schema,
- table: "WorkflowDefinitionLabels",
- column: "TenantId");
-
migrationBuilder.CreateIndex(
name: "WorkflowDefinitionLabel_WorkflowDefinitionId",
schema: _schema.Schema,
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.Designer.cs
new file mode 100644
index 0000000000..d1b0b49cee
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.Designer.cs
@@ -0,0 +1,82 @@
+//
+using Elsa.EntityFrameworkCore.Modules.Labels;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
+{
+ [DbContext(typeof(LabelsElsaDbContext))]
+ [Migration("20240329200817_V3_1")]
+ partial class V3_1
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.14")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Labels.Entities.Label", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Color")
+ .HasColumnType("longtext");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("Id");
+
+ b.ToTable("Labels", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("LabelId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LabelId")
+ .HasDatabaseName("WorkflowDefinitionLabel_LabelId");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId");
+
+ b.ToTable("WorkflowDefinitionLabels", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.cs
new file mode 100644
index 0000000000..c6ee183fe5
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
+{
+ ///
+ public partial class V3_1 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_1(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.Designer.cs
new file mode 100644
index 0000000000..cdd9a69484
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.Designer.cs
@@ -0,0 +1,82 @@
+//
+using Elsa.EntityFrameworkCore.Modules.Labels;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
+{
+ [DbContext(typeof(LabelsElsaDbContext))]
+ [Migration("20240610184957_V3_2")]
+ partial class V3_2
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.20")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Labels.Entities.Label", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Color")
+ .HasColumnType("longtext");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("Id");
+
+ b.ToTable("Labels", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("LabelId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LabelId")
+ .HasDatabaseName("WorkflowDefinitionLabel_LabelId");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId");
+
+ b.ToTable("WorkflowDefinitionLabels", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.cs
new file mode 100644
index 0000000000..290adf17a3
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
+{
+ ///
+ public partial class V3_2 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_2(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241026094901_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240715193630_V3_3.Designer.cs
similarity index 98%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241026094901_V3_3.Designer.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240715193630_V3_3.Designer.cs
index 27a7733d48..b4897f3888 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241026094901_V3_3.Designer.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240715193630_V3_3.Designer.cs
@@ -10,7 +10,7 @@
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
{
[DbContext(typeof(LabelsElsaDbContext))]
- [Migration("20241026094901_V3_3")]
+ [Migration("20240715193630_V3_3")]
partial class V3_3
{
///
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240715193630_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240715193630_V3_3.cs
new file mode 100644
index 0000000000..9398228db1
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240715193630_V3_3.cs
@@ -0,0 +1,63 @@
+#nullable disable
+
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels
+{
+ ///
+ public partial class V3_3 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_3(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "WorkflowDefinitionLabels",
+ type: "varchar(255)",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Labels",
+ type: "longtext",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateIndex(
+ name: "WorkflowDefinitionLabel_TenantId",
+ schema: _schema.Schema,
+ table: "WorkflowDefinitionLabels",
+ column: "TenantId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "WorkflowDefinitionLabel_TenantId",
+ schema: _schema.Schema,
+ table: "WorkflowDefinitionLabels");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "WorkflowDefinitionLabels");
+
+ migrationBuilder.DropColumn(
+ name: "TenantId",
+ schema: _schema.Schema,
+ table: "Labels");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.Designer.cs
new file mode 100644
index 0000000000..298abc2f61
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.Designer.cs
@@ -0,0 +1,193 @@
+//
+using System;
+using Elsa.EntityFrameworkCore.Modules.Management;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management
+{
+ [DbContext(typeof(ManagementElsaDbContext))]
+ [Migration("20231015122223_Initial")]
+ partial class Initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("BinaryData")
+ .HasColumnType("longblob");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Data")
+ .HasColumnType("longtext");
+
+ b.Property("DefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("IsLatest")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsPublished")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsReadonly")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("MaterializerContext")
+ .HasColumnType("longtext");
+
+ b.Property("MaterializerName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ProviderName")
+ .HasColumnType("longtext");
+
+ b.Property("StringData")
+ .HasColumnType("longtext");
+
+ b.Property("ToolVersion")
+ .HasColumnType("longtext");
+
+ b.Property("UsableAsActivity")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IsLatest")
+ .HasDatabaseName("IX_WorkflowDefinition_IsLatest");
+
+ b.HasIndex("IsPublished")
+ .HasDatabaseName("IX_WorkflowDefinition_IsPublished");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_WorkflowDefinition_Name");
+
+ b.HasIndex("UsableAsActivity")
+ .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity");
+
+ b.HasIndex("Version")
+ .HasDatabaseName("IX_WorkflowDefinition_Version");
+
+ b.HasIndex("DefinitionId", "Version")
+ .IsUnique()
+ .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version");
+
+ b.ToTable("WorkflowDefinitions", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Data")
+ .HasColumnType("longtext");
+
+ b.Property("DefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("DefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FinishedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("IncidentCount")
+ .HasColumnType("int");
+
+ b.Property("Name")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("SubStatus")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CorrelationId")
+ .HasDatabaseName("IX_WorkflowInstance_CorrelationId");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_WorkflowInstance_CreatedAt");
+
+ b.HasIndex("DefinitionId")
+ .HasDatabaseName("IX_WorkflowInstance_DefinitionId");
+
+ b.HasIndex("FinishedAt")
+ .HasDatabaseName("IX_WorkflowInstance_FinishedAt");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_WorkflowInstance_Name");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_WorkflowInstance_Status");
+
+ b.HasIndex("SubStatus")
+ .HasDatabaseName("IX_WorkflowInstance_SubStatus");
+
+ b.HasIndex("UpdatedAt")
+ .HasDatabaseName("IX_WorkflowInstance_UpdatedAt");
+
+ b.HasIndex("Status", "DefinitionId")
+ .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId");
+
+ b.HasIndex("Status", "SubStatus")
+ .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus");
+
+ b.HasIndex("SubStatus", "DefinitionId")
+ .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId");
+
+ b.HasIndex("Status", "SubStatus", "DefinitionId", "Version")
+ .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version");
+
+ b.ToTable("WorkflowInstances", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241026094749_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.cs
similarity index 82%
rename from src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241026094749_V3_3.cs
rename to src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.cs
index 5d5c007edf..7c52ef258c 100644
--- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241026094749_V3_3.cs
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.cs
@@ -1,26 +1,22 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management
{
///
- public partial class V3_3 : Migration
+ public partial class Initial : Migration
{
- private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema;
-
- ///
- public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema)
+ private readonly IElsaDbContextSchema _schema;
+ public Initial(IElsaDbContextSchema schema)
{
- _schema = schema;
+ _schema = schema ?? throw new ArgumentNullException(nameof(schema));
}
-
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
- name: "Elsa");
+ name: _schema.Schema);
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
@@ -50,12 +46,9 @@ protected override void Up(MigrationBuilder migrationBuilder)
.Annotation("MySql:CharSet", "utf8mb4"),
BinaryData = table.Column(type: "longblob", nullable: true),
IsReadonly = table.Column(type: "tinyint(1)", nullable: false),
- IsSystem = table.Column(type: "tinyint(1)", nullable: false),
Data = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UsableAsActivity = table.Column(type: "tinyint(1)", nullable: true),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
CreatedAt = table.Column(type: "datetime(6)", nullable: false),
Version = table.Column(type: "int", nullable: false),
IsLatest = table.Column(type: "tinyint(1)", nullable: false),
@@ -79,8 +72,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
DefinitionVersionId = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Version = table.Column(type: "int", nullable: false),
- ParentWorkflowInstanceId = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
SubStatus = table.Column(type: "varchar(255)", nullable: false)
@@ -90,15 +81,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
Name = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IncidentCount = table.Column(type: "int", nullable: false),
- IsSystem = table.Column(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column(type: "datetime(6)", nullable: false),
FinishedAt = table.Column(type: "datetime(6)", nullable: true),
Data = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DataCompressionAlgorithm = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- TenantId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
@@ -126,24 +112,12 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "WorkflowDefinitions",
column: "IsPublished");
- migrationBuilder.CreateIndex(
- name: "IX_WorkflowDefinition_IsSystem",
- schema: _schema.Schema,
- table: "WorkflowDefinitions",
- column: "IsSystem");
-
migrationBuilder.CreateIndex(
name: "IX_WorkflowDefinition_Name",
schema: _schema.Schema,
table: "WorkflowDefinitions",
column: "Name");
- migrationBuilder.CreateIndex(
- name: "IX_WorkflowDefinition_TenantId",
- schema: _schema.Schema,
- table: "WorkflowDefinitions",
- column: "TenantId");
-
migrationBuilder.CreateIndex(
name: "IX_WorkflowDefinition_UsableAsActivity",
schema: _schema.Schema,
@@ -180,12 +154,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "WorkflowInstances",
column: "FinishedAt");
- migrationBuilder.CreateIndex(
- name: "IX_WorkflowInstance_IsSystem",
- schema: _schema.Schema,
- table: "WorkflowInstances",
- column: "IsSystem");
-
migrationBuilder.CreateIndex(
name: "IX_WorkflowInstance_Name",
schema: _schema.Schema,
@@ -228,12 +196,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "WorkflowInstances",
columns: new[] { "SubStatus", "DefinitionId" });
- migrationBuilder.CreateIndex(
- name: "IX_WorkflowInstance_TenantId",
- schema: _schema.Schema,
- table: "WorkflowInstances",
- column: "TenantId");
-
migrationBuilder.CreateIndex(
name: "IX_WorkflowInstance_UpdatedAt",
schema: _schema.Schema,
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.Designer.cs
new file mode 100644
index 0000000000..0828c2c2fb
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.Designer.cs
@@ -0,0 +1,211 @@
+//
+using System;
+using Elsa.EntityFrameworkCore.Modules.Management;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management
+{
+ [DbContext(typeof(ManagementElsaDbContext))]
+ [Migration("20240329200720_V3_1")]
+ partial class V3_1
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "7.0.14")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("BinaryData")
+ .HasColumnType("longblob");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Data")
+ .HasColumnType("longtext");
+
+ b.Property("DefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("IsLatest")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsPublished")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsReadonly")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSystem")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("MaterializerContext")
+ .HasColumnType("longtext");
+
+ b.Property("MaterializerName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ProviderName")
+ .HasColumnType("longtext");
+
+ b.Property("StringData")
+ .HasColumnType("longtext");
+
+ b.Property("ToolVersion")
+ .HasColumnType("longtext");
+
+ b.Property("UsableAsActivity")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IsLatest")
+ .HasDatabaseName("IX_WorkflowDefinition_IsLatest");
+
+ b.HasIndex("IsPublished")
+ .HasDatabaseName("IX_WorkflowDefinition_IsPublished");
+
+ b.HasIndex("IsSystem")
+ .HasDatabaseName("IX_WorkflowDefinition_IsSystem");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_WorkflowDefinition_Name");
+
+ b.HasIndex("UsableAsActivity")
+ .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity");
+
+ b.HasIndex("Version")
+ .HasDatabaseName("IX_WorkflowDefinition_Version");
+
+ b.HasIndex("DefinitionId", "Version")
+ .IsUnique()
+ .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version");
+
+ b.ToTable("WorkflowDefinitions", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Data")
+ .HasColumnType("longtext");
+
+ b.Property("DataCompressionAlgorithm")
+ .HasColumnType("longtext");
+
+ b.Property("DefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("DefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FinishedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("IncidentCount")
+ .HasColumnType("int");
+
+ b.Property("IsSystem")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("Name")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ParentWorkflowInstanceId")
+ .HasColumnType("longtext");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("SubStatus")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CorrelationId")
+ .HasDatabaseName("IX_WorkflowInstance_CorrelationId");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_WorkflowInstance_CreatedAt");
+
+ b.HasIndex("DefinitionId")
+ .HasDatabaseName("IX_WorkflowInstance_DefinitionId");
+
+ b.HasIndex("FinishedAt")
+ .HasDatabaseName("IX_WorkflowInstance_FinishedAt");
+
+ b.HasIndex("IsSystem")
+ .HasDatabaseName("IX_WorkflowInstance_IsSystem");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_WorkflowInstance_Name");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_WorkflowInstance_Status");
+
+ b.HasIndex("SubStatus")
+ .HasDatabaseName("IX_WorkflowInstance_SubStatus");
+
+ b.HasIndex("UpdatedAt")
+ .HasDatabaseName("IX_WorkflowInstance_UpdatedAt");
+
+ b.HasIndex("Status", "DefinitionId")
+ .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId");
+
+ b.HasIndex("Status", "SubStatus")
+ .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus");
+
+ b.HasIndex("SubStatus", "DefinitionId")
+ .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId");
+
+ b.HasIndex("Status", "SubStatus", "DefinitionId", "Version")
+ .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version");
+
+ b.ToTable("WorkflowInstances", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.cs
new file mode 100644
index 0000000000..e4fa114e6d
--- /dev/null
+++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.cs
@@ -0,0 +1,100 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management
+{
+ ///
+ public partial class V3_1 : Migration
+ {
+ private readonly IElsaDbContextSchema _schema;
+
+ ///
+ public V3_1(IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "DataCompressionAlgorithm",
+ schema: _schema.Schema,
+ table: "WorkflowInstances",
+ type: "longtext",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "IsSystem",
+ schema: _schema.Schema,
+ table: "WorkflowInstances",
+ type: "tinyint(1)",
+ nullable: false,
+ defaultValue: false);
+
+ migrationBuilder.AddColumn(
+ name: "ParentWorkflowInstanceId",
+ schema: _schema.Schema,
+ table: "WorkflowInstances",
+ type: "longtext",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn