Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions entity-framework/core/cli/powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Parameters:
| <nobr>`-Name <String>`</nobr> | The name of the migration. This is a positional parameter and is required. |
| <nobr>`-OutputDir <String>`</nobr> | The directory use to output the files. Paths are relative to the target project directory. Defaults to "Migrations". |
| <nobr>`-Namespace <String>`</nobr> | The namespace to use for the generated classes. Defaults to generated from the output directory. |
| <nobr>`-NoBuild`</nobr> | Don't build the project before running the command. Intended to be used when the build is up-to-date. Added in EF Core 11. |

The [common parameters](#common-parameters) are listed above.

Expand Down Expand Up @@ -319,6 +320,7 @@ Updates the database to the last migration or to a specified migration.
| <nobr>`-Add`</nobr> | Creates a new migration and applies it to the database in a single step. Uses Roslyn to compile the migration at runtime. When specified, a migration name is required and provides the name for the new migration. Added in EF Core 11. |
| <nobr>`-OutputDir <String>`</nobr> | The directory to put migration files in. Paths are relative to the target project directory. Requires `-Add`. Added in EF Core 11. |
| <nobr>`-Namespace <String>`</nobr> | The namespace to use for the generated migration classes. Requires `-Add`. Added in EF Core 11. |
| <nobr>`-NoBuild`</nobr> | Don't build the project before running the command. Intended to be used when the build is up-to-date. Added in EF Core 11. |

The [common parameters](#common-parameters) are listed above.

Expand Down
17 changes: 17 additions & 0 deletions entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,23 @@ Explicit command-line options always take precedence over configuration file val

For more information, see [Configuration file](xref:core/cli/dotnet#configuration-file).

<a name="pmc-nobuild"></a>

### `-NoBuild` for PMC migrations commands

Starting with EF Core 11, the Package Manager Console `Add-Migration` and `Update-Database` commands support the `-NoBuild` switch, which skips the project build step before running the command.

This is useful when a build succeeds but produces warnings that Visual Studio's Package Manager Console treats as errors (such as NuGet vulnerability warnings), which would otherwise block the commands from running:

```powershell
Add-Migration MyMigration -NoBuild
Update-Database -NoBuild
```

Only use `-NoBuild` when the project is already up-to-date, since running with a stale build may produce unexpected results.

For more information, see the [PMC tools reference](xref:core/cli/powershell).

<a name="dotnet-ef-context-wildcard"></a>

### Wildcard context support for migration commands
Expand Down
Loading