-
Notifications
You must be signed in to change notification settings - Fork 855
Add a hosting integration for the dotnet ef global tool #10306
Copy link
Copy link
Labels
area-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packagesentityframeworkpod-e2e
Milestone
Description
Create a new hosting integration that provides integration with the dotnet ef global tool.
Package name: Aspire.Hosting.dotnet-ef
Assembly name: Aspire.Hosting.DotnetEf
High-level feature outline
This isn't intended to be a final spec. Details should be discussed and iterated on as part of implementation and the shape and/or set of functionality may change:
- Top-level resource for adding functionality associated with
dotnet ef, e.g.:builder.AddDotnetEf("dotnet-ef"); - Support for auto-acquiring the
dotnet-eftool package if not already installed (options for global vs. local install, default to install local if required version not already installed globally?) - Support for producing migration scripts and/or migration bundles as part of publishing the AppHost, e.g.
.PublishAsMigrationScript() - Support for running migrations on AppHost start and having other resources wait on the migrations to complete, e.g.:
var ef = builder.AddDotnetEf("dotnet-ef"); var api = builder.AddProject<Api>("api"); var apiMigrations = api.AddEfMigrations("api-migrations", ef).RunDatabaseUpdateOnStart();
- Adds resource commands for
dotnet efto resources thatAddEfMigrationswas called on:- "Update database": Runs the
dotnet ef database updatecommand on the resource - "Drop database": Runs the
dotnet ef database dropcommand on the resource - "Reset database": Runs
dotnet ef database dropfollowed bydotnet ef database updateon the resource - "Add migration...": Prompts for a migration name (and some options from
dotnet ef migrations add) before runningdotnet ef migrations add <NAME>on the resource. If the resource is not stopped, we should pass the--no-buildoption. - "Remove migration": Runs
dotnet ef migrations removeon the resource to remove the last migration - "Remove migration (force)": Prompts for confirmation and then runs
dotnet ef migrations remove -forceon the resource to remove the last migration and revert it from the database
- "Update database": Runs the
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packagesentityframeworkpod-e2e