EFCore6.0.AutomaticMigrations
6.0.0.1
.NET 6.0
dotnet add package EFCore6.0.AutomaticMigrations --version 6.0.0.1
NuGet\Install-Package EFCore6.0.AutomaticMigrations -Version 6.0.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EFCore6.0.AutomaticMigrations" Version="6.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EFCore6.0.AutomaticMigrations --version 6.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EFCore6.0.AutomaticMigrations, 6.0.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EFCore6.0.AutomaticMigrations as a Cake Addin
#addin nuget:?package=EFCore6.0.AutomaticMigrations&version=6.0.0.1
// Install EFCore6.0.AutomaticMigrations as a Cake Tool
#tool nuget:?package=EFCore6.0.AutomaticMigrations&version=6.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
About the package
Enable Automatic Migrations for Entity Framework Core for SQL Databases.
Usage
DbMigrationsOptions object allows to configure migration options:
AutomaticMigrationDataLossAllowed - default true
AutomaticMigrationsEnabled- default true
The package support following ways to apply the migrations:
- Using MigrateDatabaseToLatestVersion
- Execute<TContext>(TContext context);
- ExecuteAsync<TContext>(TContext context);
- Execute<TContext, TMigrationsOptions>(TContext context, TMigrationsOptions options);
- ExecuteAsync<TContext, TMigrationsOptions>(TContext context, TMigrationsOptions options);
//Get context
var context = services.GetRequiredService<YourContext>();
//Apply migrations
MigrateDatabaseToLatestVersion.Execute(context);
- Using Context extensions methods
- MigrateToLatestVersion<TContext>(this TContext context);
- MigrateToLatestVersionAsync<TContext>(this TContext context);
- MigrateToLatestVersion<TContext, TMigrationsOptions>(this TContext context, TMigrationsOptions options);
- MigrateToLatestVersionAsync<TContext, TMigrationsOptions>(this TContext context, TMigrationsOptions options);
//Get context
var context = services.GetRequiredService<YourContext>();
//Apply migrations
context.MigrateToLatestVersion()
Roadmap
- Option to view all migrations
- Apply different migrations version
Product | Versions |
---|---|
.NET | net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.CodeAnalysis.CSharp (>= 4.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Update to support EF Core 6.0.0