Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,15 @@ public V3_4(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: _schema.Schema);

migrationBuilder.RenameTable(
name: "AlterationPlans",
newName: "AlterationPlans",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "AlterationJobs",
newName: "AlterationJobs",
newSchema: _schema.Schema);
// SQLite does not support schemas.
// This migration was attempting to move tables to a schema, which is not needed for SQLite.
// No operations required.
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "AlterationPlans",
schema: _schema.Schema,
newName: "AlterationPlans");

migrationBuilder.RenameTable(
name: "AlterationJobs",
schema: _schema.Schema,
newName: "AlterationJobs");
// No operations required.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,15 @@ public V3_4(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: _schema.Schema);

migrationBuilder.RenameTable(
name: "Users",
newName: "Users",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "Roles",
newName: "Roles",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "Applications",
newName: "Applications",
newSchema: _schema.Schema);
// SQLite does not support schemas.
// This migration was attempting to move tables to a schema, which is not needed for SQLite.
// No operations required.
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "Users",
schema: _schema.Schema,
newName: "Users");

migrationBuilder.RenameTable(
name: "Roles",
schema: _schema.Schema,
newName: "Roles");

migrationBuilder.RenameTable(
name: "Applications",
schema: _schema.Schema,
newName: "Applications");
// No operations required.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,15 @@ public V3_4(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: _schema.Schema);

migrationBuilder.RenameTable(
name: "WorkflowDefinitionLabels",
newName: "WorkflowDefinitionLabels",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "Labels",
newName: "Labels",
newSchema: _schema.Schema);
// SQLite does not support schemas.
// This migration was attempting to move tables to a schema, which is not needed for SQLite.
// No operations required.
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "WorkflowDefinitionLabels",
schema: _schema.Schema,
newName: "WorkflowDefinitionLabels");

migrationBuilder.RenameTable(
name: "Labels",
schema: _schema.Schema,
newName: "Labels");
// No operations required.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,16 @@ public V3_4(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: _schema.Schema);

migrationBuilder.RenameTable(
name: "WorkflowInstances",
newName: "WorkflowInstances",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "WorkflowDefinitions",
newName: "WorkflowDefinitions",
newSchema: _schema.Schema);

// SQLite does not support schemas, so we only add the column and index without schema qualifiers
migrationBuilder.AddColumn<bool>(
name: "IsExecuting",
schema: _schema.Schema,
table: "WorkflowInstances",
type: "INTEGER",
nullable: false,
defaultValue: false);

migrationBuilder.CreateIndex(
name: "IX_WorkflowInstance_IsExecuting",
schema: _schema.Schema,
table: "WorkflowInstances",
column: "IsExecuting");
}
Expand All @@ -51,23 +37,11 @@ protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_WorkflowInstance_IsExecuting",
schema: _schema.Schema,
table: "WorkflowInstances");

migrationBuilder.DropColumn(
name: "IsExecuting",
schema: _schema.Schema,
table: "WorkflowInstances");

migrationBuilder.RenameTable(
name: "WorkflowInstances",
schema: _schema.Schema,
newName: "WorkflowInstances");

migrationBuilder.RenameTable(
name: "WorkflowDefinitions",
schema: _schema.Schema,
newName: "WorkflowDefinitions");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public V3_6(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// SQLite does not support schemas, so we omit the schema parameter
migrationBuilder.AddColumn<string>(
name: "OriginalSource",
schema: _schema.Schema,
table: "WorkflowDefinitions",
type: "TEXT",
nullable: true);
Expand All @@ -31,7 +31,6 @@ protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OriginalSource",
schema: _schema.Schema,
table: "WorkflowDefinitions");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,82 +18,15 @@ public V3_4(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: _schema.Schema);

migrationBuilder.RenameTable(
name: "WorkflowInboxMessages",
newName: "WorkflowInboxMessages",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "WorkflowExecutionLogRecords",
newName: "WorkflowExecutionLogRecords",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "Triggers",
newName: "Triggers",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "KeyValuePairs",
newName: "KeyValuePairs",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "Bookmarks",
newName: "Bookmarks",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "BookmarkQueueItems",
newName: "BookmarkQueueItems",
newSchema: _schema.Schema);

migrationBuilder.RenameTable(
name: "ActivityExecutionRecords",
newName: "ActivityExecutionRecords",
newSchema: _schema.Schema);
// SQLite does not support schemas.
// This migration was attempting to move tables to a schema, which is not needed for SQLite.
// No operations required.
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "WorkflowInboxMessages",
schema: _schema.Schema,
newName: "WorkflowInboxMessages");

migrationBuilder.RenameTable(
name: "WorkflowExecutionLogRecords",
schema: _schema.Schema,
newName: "WorkflowExecutionLogRecords");

migrationBuilder.RenameTable(
name: "Triggers",
schema: _schema.Schema,
newName: "Triggers");

migrationBuilder.RenameTable(
name: "KeyValuePairs",
schema: _schema.Schema,
newName: "KeyValuePairs");

migrationBuilder.RenameTable(
name: "Bookmarks",
schema: _schema.Schema,
newName: "Bookmarks");

migrationBuilder.RenameTable(
name: "BookmarkQueueItems",
schema: _schema.Schema,
newName: "BookmarkQueueItems");

migrationBuilder.RenameTable(
name: "ActivityExecutionRecords",
schema: _schema.Schema,
newName: "ActivityExecutionRecords");
// No operations required.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public V3_5(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// SQLite does not support schemas, so we omit the schema parameter
migrationBuilder.AlterColumn<string>(
name: "Name",
schema: _schema.Schema,
table: "Triggers",
type: "TEXT",
nullable: true,
Expand All @@ -29,41 +29,35 @@ protected override void Up(MigrationBuilder migrationBuilder)

migrationBuilder.AddColumn<string>(
name: "Name",
schema: _schema.Schema,
table: "Bookmarks",
type: "TEXT",
nullable: true);

migrationBuilder.AddColumn<int>(
name: "AggregateFaultCount",
schema: _schema.Schema,
table: "ActivityExecutionRecords",
type: "INTEGER",
nullable: false,
defaultValue: 0);

migrationBuilder.AddColumn<string>(
name: "SerializedMetadata",
schema: _schema.Schema,
table: "ActivityExecutionRecords",
type: "TEXT",
nullable: true);

migrationBuilder.CreateIndex(
name: "IX_StoredBookmark_Name",
schema: _schema.Schema,
table: "Bookmarks",
column: "Name");

migrationBuilder.CreateIndex(
name: "IX_StoredBookmark_Name_Hash",
schema: _schema.Schema,
table: "Bookmarks",
columns: new[] { "Name", "Hash" });

migrationBuilder.CreateIndex(
name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId",
schema: _schema.Schema,
table: "Bookmarks",
columns: new[] { "Name", "Hash", "WorkflowInstanceId" });
}
Expand All @@ -73,37 +67,30 @@ protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_StoredBookmark_Name",
schema: _schema.Schema,
table: "Bookmarks");

migrationBuilder.DropIndex(
name: "IX_StoredBookmark_Name_Hash",
schema: _schema.Schema,
table: "Bookmarks");

migrationBuilder.DropIndex(
name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId",
schema: _schema.Schema,
table: "Bookmarks");

migrationBuilder.DropColumn(
name: "Name",
schema: _schema.Schema,
table: "Bookmarks");

migrationBuilder.DropColumn(
name: "AggregateFaultCount",
schema: _schema.Schema,
table: "ActivityExecutionRecords");

migrationBuilder.DropColumn(
name: "SerializedMetadata",
schema: _schema.Schema,
table: "ActivityExecutionRecords");

migrationBuilder.AlterColumn<string>(
name: "Name",
schema: _schema.Schema,
table: "Triggers",
type: "TEXT",
nullable: false,
Expand Down
Loading