Skip to content

Commit

Permalink
Added TenantId column to multiple tables
Browse files Browse the repository at this point in the history
In the database migration script, the "TenantId" column has been added to the Triggers, Bookmarks, WorkflowExecutionLogRecords, ActivityExecutionRecords, and KeyValuePairs tables. Also, the process of removal of the same column from these tables has been scripted for rollback scenarios.
  • Loading branch information
sfmskywalker committed May 26, 2024
1 parent 24ad920 commit 473f162
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/modules/Elsa.Dapper.Migrations/Runtime/V3_2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ public class V3_2 : Migration
public override void Up()
{
Delete.Table("WorkflowInboxMessages");
Alter.Table("Triggers").AddColumn("TenantId").AsString().Nullable();
Alter.Table("Bookmarks").AddColumn("TenantId").AsString().Nullable();
Alter.Table("WorkflowExecutionLogRecords").AddColumn("TenantId").AsString().Nullable();
Alter.Table("ActivityExecutionRecords").AddColumn("TenantId").AsString().Nullable();
Alter.Table("KeyValuePairs").AddColumn("TenantId").AsString().Nullable();
}

/// <inheritdoc />
public override void Down()
{
Delete.Column("TenantId").FromTable("Triggers");
Delete.Column("TenantId").FromTable("Bookmarks");
Delete.Column("TenantId").FromTable("WorkflowExecutionLogRecords");
Delete.Column("TenantId").FromTable("ActivityExecutionRecords");
Delete.Column("TenantId").FromTable("KeyValuePairs");

IfDatabase("SqlServer", "Oracle", "MySql", "Postgres")
.Create
.Table("WorkflowInboxMessages")
Expand Down

0 comments on commit 473f162

Please sign in to comment.