RelationalDatabaseFacadeExtensions.Migrate メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| Name | 説明 |
|---|---|
| Migrate(DatabaseFacade) |
コンテキストの保留中の移行をデータベースに適用します。 データベースがまだ存在しない場合は、データベースを作成します。 |
| Migrate(DatabaseFacade, String) |
コンテキストの移行をデータベースに適用します。 データベースがまだ存在しない場合は、データベースを作成します。 |
Migrate(DatabaseFacade)
コンテキストの保留中の移行をデータベースに適用します。 データベースがまだ存在しない場合は、データベースを作成します。
public static void Migrate(this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT Use a migration bundle or an alternate way of executing migration operations.")]
public static void Migrate(this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade);
static member Migrate : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade -> unit
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT Use a migration bundle or an alternate way of executing migration operations.")>]
static member Migrate : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade -> unit
<Extension()>
Public Sub Migrate (databaseFacade As DatabaseFacade)
パラメーター
- databaseFacade
- DatabaseFacade
コンテキストの DatabaseFacade 。
- 属性
注釈
この API は、 EnsureCreated()と相互に排他的であることに注意してください。 EnsureCreated では、データベースの作成に移行が使用されないため、作成されたデータベースを後で移行を使用して更新することはできません。
詳細と例については、「 データベースの移行 」を参照してください。
適用対象
Migrate(DatabaseFacade, String)
コンテキストの移行をデータベースに適用します。 データベースがまだ存在しない場合は、データベースを作成します。
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT Use a migration bundle or an alternate way of executing migration operations.")]
public static void Migrate(this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade, string? targetMigration);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT Use a migration bundle or an alternate way of executing migration operations.")>]
static member Migrate : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade * string -> unit
<Extension()>
Public Sub Migrate (databaseFacade As DatabaseFacade, targetMigration As String)
パラメーター
- databaseFacade
- DatabaseFacade
コンテキストの DatabaseFacade 。
- targetMigration
- String
データベースを移行するターゲット移行、または最新のデータベースに移行する null 。
- 属性
注釈
この API は、 EnsureCreated()と相互に排他的であることに注意してください。 EnsureCreated では、データベースの作成に移行が使用されないため、作成されたデータベースを後で移行を使用して更新することはできません。
詳細と例については、「 データベースの移行 」を参照してください。