* Add code activity * Refactor Workflow State to use Variables * Update InstantEvent and SetVariable * Update samples * Add activity input/output |
||
|---|---|---|
| .. | ||
| CustomSchema | ||
| DbContexts | ||
| Entities | ||
| Extensions | ||
| Mapping | ||
| Migrations | ||
| Services | ||
| Elsa.Persistence.EntityFrameworkCore.csproj | ||
| EntityFrameworkCoreElsaBuilder.cs | ||
| icon.png | ||
| README.md | ||
Generating migrations
We should generate migration sets per provider as described here: https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/providers?tabs=dotnet-core-cli
Example commands:
dotnet ef migrations add InitialCreate --context SqliteContext --output-dir Migrations/Sqlite
dotnet ef migrations add InitialCreate --context SqlServerContext --output-dir Migrations/SqlServer
dotnet ef migrations add InitialCreate --context PostgreSqlContext --output-dir Migrations/PostgreSql
Creating and updating the Sqlite database
First, set the appropriate connection string. To create the database, run the migrations.
Example command:
SET EF_CONNECTIONSTRING="Data Source=c:\data\elsa.db;Cache=Shared"
dotnet ef database update --context SqliteContext
SET EF_CONNECTIONSTRING="Server=localhost;Database=Elsa;User=sa;Password=Secret_password123!;"
dotnet ef database update --context SqlServerContext
SET EF_CONNECTIONSTRING="Server=localhost;Database=Elsa;Port=5432;User Id=postgres;Password=Secret_password123!"
dotnet ef database update --context PostgreSqlContext