elsa-core/src/persistence/Elsa.Persistence.EntityFrameworkCore
Sipke Schoorstra 61c9ac48c7 Update packages
2019-12-10 15:46:49 +01:00
..
DbContexts Feature: Persistence Provider -> Added PostgreSql support to Elsa.Persistence.EntityFrameworkCore via Npgsql (#201) 2019-11-28 11:35:30 +01:00
Entities EF Core Provider rewrite (#165) 2019-11-16 14:06:53 +01:00
Extensions Add SQL Server example 2019-11-26 22:54:06 +01:00
Mapping EF Core Provider rewrite (#165) 2019-11-16 14:06:53 +01:00
Migrations Feature: Persistence Provider -> Added PostgreSql support to Elsa.Persistence.EntityFrameworkCore via Npgsql (#201) 2019-11-28 11:35:30 +01:00
Services Add SQL Server example 2019-11-26 22:54:06 +01:00
Elsa.Persistence.EntityFrameworkCore.csproj Update packages 2019-12-10 15:46:49 +01:00
EntityFrameworkCoreElsaBuilder.cs Workflow Registry refresh upon workflow definition updates (#101) 2019-10-23 21:23:25 +02:00
icon.png Add icons to packages 2019-11-22 17:34:55 +01:00
MultipleActiveResultSets Add Dropbox activity 2019-09-22 21:33:32 +02:00
README.md Feature: Persistence Provider -> Added PostgreSql support to Elsa.Persistence.EntityFrameworkCore via Npgsql (#201) 2019-11-28 11:35:30 +01:00

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