diff --git a/entity-framework/core/miscellaneous/cli/dotnet.md b/entity-framework/core/miscellaneous/cli/dotnet.md index 2208994747..1375c173a3 100644 --- a/entity-framework/core/miscellaneous/cli/dotnet.md +++ b/entity-framework/core/miscellaneous/cli/dotnet.md @@ -187,11 +187,18 @@ Arguments: |:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `` | The target migration. Migrations may be identified by name or by ID. The number 0 is a special case that means *before the first migration* and causes all migrations to be reverted. If no migration is specified, the command defaults to the last migration. | -The following examples update the database to a specified migration. The first uses the migration name and the second uses the migration ID: +Options: + +| | Option | Description | +|:------------------|:-------------------------|:---------------------------------------------------------| +| | `--connection ` | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. | + + +The following examples update the database to a specified migration. The first uses the migration name and the second uses the migration ID and a specified connection: ```dotnetcli dotnet ef database update InitialCreate -dotnet ef database update 20180904195021_InitialCreate +dotnet ef database update 20180904195021_InitialCreate --connection your_connection_string ``` ## dotnet ef dbcontext info diff --git a/entity-framework/core/miscellaneous/cli/powershell.md b/entity-framework/core/miscellaneous/cli/powershell.md index 15f652af32..fa24738630 100644 --- a/entity-framework/core/miscellaneous/cli/powershell.md +++ b/entity-framework/core/miscellaneous/cli/powershell.md @@ -129,7 +129,7 @@ The following table shows parameters that are common to all of the EF Core comma |:--------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | -Context \ | The `DbContext` class to use. Class name only or fully qualified with namespaces. If this parameter is omitted, EF Core finds the context class. If there are multiple context classes, this parameter is required. | | -Project \ | The target project. If this parameter is omitted, the **Default project** for **Package Manager Console** is used as the target project. | -| -StartupProject \ | The startup project. If this parameter is omitted, the **Startup project** in **Solution properties** is used as the target project. | +| -StartupProject \ | The startup project. If this parameter is omitted, the **Startup project** in **Solution properties** is used as the target project. | | -Verbose | Show verbose output. | To show help information about a command, use PowerShell's `Get-Help` command. @@ -241,6 +241,7 @@ Updates the database to the last migration or to a specified migration. | Parameter | Description | |:------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | *-Migration* \ | The target migration. Migrations may be identified by name or by ID. The number 0 is a special case that means *before the first migration* and causes all migrations to be reverted. If no migration is specified, the command defaults to the last migration. | +| -Connection \ | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. | > [!TIP] > The Migration parameter supports tab-expansion. @@ -251,11 +252,11 @@ The following example reverts all migrations. Update-Database -Migration 0 ``` -The following examples update the database to a specified migration. The first uses the migration name and the second uses the migration ID: +The following examples update the database to a specified migration. The first uses the migration name and the second uses the migration ID and a specified connection: ```powershell Update-Database -Migration InitialCreate -Update-Database -Migration 20180904195021_InitialCreate +Update-Database -Migration 20180904195021_InitialCreate -Connection your_connection_string ``` ## Additional resources