liveBook · Manning

Migration bundle application

As explained in Building Web APIs with ASP.NET Core

A migration bundle is a self-contained executable that applies Entity Framework Core database migrations without requiring the .NET SDK or database-management CLI on the target machine.

A migration bundle is a self-contained executable for applying Entity Framework Core database migrations in production. It runs without the .NET SDK, dotnet-ef CLI, or a SQL management tool installed on the target machine. section 12.4.4

Choose a database-structure deployment approach according to the production environment:

  • Generate and execute a SQL script; a database administrator can review or adjust the SQL, but execution requires a management tool such as SSMS. section 12.4.4
  • Create and execute a migration bundle from the development machine, avoiding software requirements on the production machine. section 12.4.4
  • Run dotnet-ef on the production machine or apply migrations programmatically with dbContext.Database.Migrate() in Program.cs. section 12.4.4

Production database setup

When the board-game tables are missing from the production database, a migration bundle can apply the pending migrations directly. SQL scripts remain practical when SSMS is already installed and review by a database administrator is important. section 12.4.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines the executable and compares deployment options, but does not show bundle-generation commands or execution steps.
Examples
Uses missing board-game tables in a production database and contrasts bundle execution with an SSMS-managed SQL script.
What it assumes
Assumes existing Entity Framework Core migrations and a development machine capable of creating the bundle.
What you can do after
Operate a self-contained migration executable on a production machine without installing the .NET SDK or database-management CLI.
How it connects
Connects Entity Framework Core migrations with SQL scripts, dotnet-ef CLI, .NET SDK, SSMS, and programmatic migration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.