diff --git a/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220117205849_Initial.Designer.cs b/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220307110612_Initial.Designer.cs similarity index 90% rename from src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220117205849_Initial.Designer.cs rename to src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220307110612_Initial.Designer.cs index ff433b558..c0e9c0958 100644 --- a/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220117205849_Initial.Designer.cs +++ b/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220307110612_Initial.Designer.cs @@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations { [DbContext(typeof(ElsaDbContext))] - [Migration("20220117205849_Initial")] + [Migration("20220307110612_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -19,6 +19,24 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); + modelBuilder.Entity("Elsa.Models.Variable", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("WorkflowDefinitionId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("WorkflowDefinitionId"); + + b.ToTable("Variable"); + }); + modelBuilder.Entity("Elsa.Persistence.Entities.WorkflowBookmark", b => { b.Property("Id") @@ -39,6 +57,9 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations .IsRequired() .HasColumnType("TEXT"); + b.Property("Data") + .HasColumnType("TEXT"); + b.Property("Hash") .HasColumnType("TEXT"); @@ -46,9 +67,6 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations .IsRequired() .HasColumnType("TEXT"); - b.Property("Payload") - .HasColumnType("TEXT"); - b.Property("WorkflowDefinitionId") .IsRequired() .HasColumnType("TEXT"); @@ -267,6 +285,9 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations b.Property("Id") .HasColumnType("TEXT"); + b.Property("Data") + .HasColumnType("TEXT"); + b.Property("Hash") .HasColumnType("TEXT"); @@ -274,9 +295,6 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations .IsRequired() .HasColumnType("TEXT"); - b.Property("Payload") - .HasColumnType("TEXT"); - b.Property("WorkflowDefinitionId") .IsRequired() .HasColumnType("TEXT"); @@ -294,6 +312,18 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations b.ToTable("WorkflowTriggers"); }); + + modelBuilder.Entity("Elsa.Models.Variable", b => + { + b.HasOne("Elsa.Persistence.Entities.WorkflowDefinition", null) + .WithMany("Variables") + .HasForeignKey("WorkflowDefinitionId"); + }); + + modelBuilder.Entity("Elsa.Persistence.Entities.WorkflowDefinition", b => + { + b.Navigation("Variables"); + }); #pragma warning restore 612, 618 } } diff --git a/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220117205849_Initial.cs b/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220307110612_Initial.cs similarity index 90% rename from src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220117205849_Initial.cs rename to src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220307110612_Initial.cs index ec91c2971..37e6609ce 100644 --- a/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220117205849_Initial.cs +++ b/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/20220307110612_Initial.cs @@ -16,7 +16,7 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations Id = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), Hash = table.Column(type: "TEXT", nullable: true), - Payload = table.Column(type: "TEXT", nullable: true), + Data = table.Column(type: "TEXT", nullable: true), WorkflowDefinitionId = table.Column(type: "TEXT", nullable: false), WorkflowInstanceId = table.Column(type: "TEXT", nullable: false), CorrelationId = table.Column(type: "TEXT", nullable: false), @@ -98,13 +98,36 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations WorkflowDefinitionId = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), Hash = table.Column(type: "TEXT", nullable: true), - Payload = table.Column(type: "TEXT", nullable: true) + Data = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_WorkflowTriggers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Variable", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + Name = table.Column(type: "TEXT", nullable: true), + WorkflowDefinitionId = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Variable", x => x.Id); + table.ForeignKey( + name: "FK_Variable_WorkflowDefinitions_WorkflowDefinitionId", + column: x => x.WorkflowDefinitionId, + principalTable: "WorkflowDefinitions", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_Variable_WorkflowDefinitionId", + table: "Variable", + column: "WorkflowDefinitionId"); + migrationBuilder.CreateIndex( name: "IX_WorkflowBookmark_ActivityId", table: "WorkflowBookmarks", @@ -255,10 +278,10 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "WorkflowBookmarks"); + name: "Variable"); migrationBuilder.DropTable( - name: "WorkflowDefinitions"); + name: "WorkflowBookmarks"); migrationBuilder.DropTable( name: "WorkflowExecutionLogRecords"); @@ -268,6 +291,9 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations migrationBuilder.DropTable( name: "WorkflowTriggers"); + + migrationBuilder.DropTable( + name: "WorkflowDefinitions"); } } } diff --git a/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/ElsaDbContextModelSnapshot.cs b/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/ElsaDbContextModelSnapshot.cs index f84321fbc..425fd4931 100644 --- a/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/ElsaDbContextModelSnapshot.cs +++ b/src/persistence/Elsa.Persistence.EntityFrameworkCore.Sqlite/Migrations/ElsaDbContextModelSnapshot.cs @@ -17,6 +17,24 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); + modelBuilder.Entity("Elsa.Models.Variable", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("WorkflowDefinitionId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("WorkflowDefinitionId"); + + b.ToTable("Variable"); + }); + modelBuilder.Entity("Elsa.Persistence.Entities.WorkflowBookmark", b => { b.Property("Id") @@ -37,6 +55,9 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations .IsRequired() .HasColumnType("TEXT"); + b.Property("Data") + .HasColumnType("TEXT"); + b.Property("Hash") .HasColumnType("TEXT"); @@ -44,9 +65,6 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations .IsRequired() .HasColumnType("TEXT"); - b.Property("Payload") - .HasColumnType("TEXT"); - b.Property("WorkflowDefinitionId") .IsRequired() .HasColumnType("TEXT"); @@ -265,6 +283,9 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations b.Property("Id") .HasColumnType("TEXT"); + b.Property("Data") + .HasColumnType("TEXT"); + b.Property("Hash") .HasColumnType("TEXT"); @@ -272,9 +293,6 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations .IsRequired() .HasColumnType("TEXT"); - b.Property("Payload") - .HasColumnType("TEXT"); - b.Property("WorkflowDefinitionId") .IsRequired() .HasColumnType("TEXT"); @@ -292,6 +310,18 @@ namespace Elsa.Persistence.EntityFrameworkCore.Sqlite.Migrations b.ToTable("WorkflowTriggers"); }); + + modelBuilder.Entity("Elsa.Models.Variable", b => + { + b.HasOne("Elsa.Persistence.Entities.WorkflowDefinition", null) + .WithMany("Variables") + .HasForeignKey("WorkflowDefinitionId"); + }); + + modelBuilder.Entity("Elsa.Persistence.Entities.WorkflowDefinition", b => + { + b.Navigation("Variables"); + }); #pragma warning restore 612, 618 } }