elsa-workflows / elsa-workflows/elsa-core

SQL Server multitenant environments missing migrations

Open
#6,456 3 comments 1 reaction 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

## Description
In a setup where both the standard workflows and the tenants use a database, the migrations are only run for the tenant side. All migrations regarding workflow definition and execution are ignored. This however does not happen if multitenancy is disabled or doesn't use SQL.

## Steps to Reproduce
1. configure Elsa.Server.Web to use SqlServer as its db pointing to an empty DB
2. enable multitenancy with SQL persistence for tenants on the same DB
3. start Elsa.Server.Web

## Expected Behavior
The DB should have all other tables as well. (workflow definitions, instances, etc)

## Actual Behavior
The DB only has the Tenants table.

## Environment
- latest code on the main branch

## Troubleshooting Attempts
It seems that this PR https://github.com/elsa-workflows/elsa-core/pull/6173 has changed the way migrations are running. Now, it is using this:

```Services.AddStartupTask>();```

Before, it was using a different startup task:

```Module.ConfigureHostedService>(-100);```

I'm note sure if both of these should be run or not. I can try to patch this but need more info on why this changed was made.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.