A VS Code extension to manage Entity Framework migrations.
- List dbContexts for all projects within a solution
- Add/remove/run/undo migrations
- dotnet sdk
- efcore tools
- A solution (
.sln
) file with projects - Microsoft.EntityFrameworkCore.Design must be installed in one of the projects
This extension contributes the following settings:
-
entityframework.env
: Custom environment vars, for example:{ "entityframework.env": { "ASPNETCORE_ENVIRONMENT": "LocalDev", "TenantId": "12345" } }
-
entityframework.commands
: Custom commands, for example:{ "entityframework.commands": { "addMigration": [ "dotnet", "ef", "migrations", "add", "\"$migrationName\"", "--project", "\"$project\"", "--startup-project", "\"$project\"", "--context", "\"$dbContext\"" ], "removeMigration": [ "dotnet", "ef", "migrations", "remove", "--project", "\"$project\"", "--startup-project", "\"$project\"", "--context", "\"$dbContext\"" ], "runMigration": [ "dotnet", "ef", "database", "update", "--project", "\"$project\"", "--startup-project", "\"$project\"", "--context", "\"$dbContext\"", "\"$migrationId\"" ], "generateScript": [ "dotnet", "ef", "dbcontext", "script", "--project", "\"$project\"", "--context", "\"$dbContext\"" ] } }
The EF tools execute application code at design time to get information about the project, thus performance can be slow on large projects.
See LICENSE.md.