migration

star 163

Manage EF Core database migrations. Use when adding, listing, or removing migrations for the workflow engine.

Altinn By Altinn schedule Updated 3/23/2026

name: migration description: Manage EF Core database migrations. Use when adding, listing, or removing migrations for the workflow engine.

Add a new migration

dotnet ef migrations add <MigrationName> \
  --project src/WorkflowEngine.Data \
  --startup-project tests/WorkflowEngine.TestApp

After generating, run dotnet csharpier format on the new migration files in src/WorkflowEngine.Data/Migrations/.

List existing migrations

dotnet ef migrations list \
  --project src/WorkflowEngine.Data \
  --startup-project tests/WorkflowEngine.TestApp

Remove the last migration (if not yet applied)

dotnet ef migrations remove \
  --project src/WorkflowEngine.Data \
  --startup-project tests/WorkflowEngine.TestApp

Important notes

  • Migrations are applied automatically on application startup via DbMigrationService — there is no need to run dotnet ef database update manually.
  • Migration files live in src/WorkflowEngine.Data/Migrations/.
  • The DbContext is EngineDbContext in WorkflowEngine.Data.
  • Always format generated migration files with CSharpier before committing.
Install via CLI
npx skills add https://github.com/Altinn/altinn-studio --skill migration
Repository Details
star Stars 163
call_split Forks 96
navigation Branch main
article Path SKILL.md
More from Creator