简体   繁体   English

如何获取dotnet ef中未应用的迁移列表

[英]how to get a list of unapply migrations in dotnet ef

I am having a bit of trouble trying to list all unapplied migrations using dotnet ef command. 尝试使用dotnet ef命令列出所有未应用的迁移时遇到麻烦。

Since I am working with other developers there are a few new migrations going in during each other development. 由于我正在与其他开发人员一起工作,因此在彼此进行开发时会有一些新的迁移。

When I run dotnet ef migrations list it will list all available migrations. 当我运行dotnet ef migrations list ,它将列出所有可用的迁移。

Is there a way to find out which migrations is not applied? 有没有办法找出未应用哪些迁移?

Coming soon as issue #577 . 即将发布, 第577期 Until then, you can get them programmatically using code like this: 在此之前,您可以使用如下代码以编程方式获取它们:

var pendingMigrations = myDbContext.Database.GetPendingMigrations();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 dotnet ef 迁移脚本如何为每次迁移生成一个脚本? - How can dotnet ef migrations script produce a script per migration? dotnet ef migrations {name} dotnet ef database update - dotnet ef migrations {name} dotnet ef database update “Do.net ef migrations add”不创建迁移 - "Dotnet ef migrations add" not creating the migration Ubuntu 19.10 中的 dotnet ef 迁移问题。 点网 SDK 3.1.1 - dotnet ef migrations issue in Ubuntu 19.10. Dotnet sdk 3.1.1 当依赖于 COM 参考时,如何使用“dotnet ef migrations add XYZ”? - How to use `dotnet ef migrations add XYZ` when there is a dependency on a COM reference? 如何让“do.net ef migrations”命令指向特定的 appsettings.json 文件? - How do I tell a `dotnet ef migrations` command point to a specific appsettings.json file? 如何卸载 EF Core 表? 或者如何删除所有迁移? 或者如何从用户代码调用`dotnet ef database update 0`? - How to uninstall EF Core tables? Or how to remove all migrations ? Or how to call `dotnet ef database update 0` from user code? 如何在带有 EF Core 的 ASP.NET Core 中取消应用迁移 - How to unapply a migration in ASP.NET Core with EF Core 为什么“dotnet ef migrations add”会启动我的应用程序? - Why does "dotnet ef migrations add" start my application? dotnet ef迁移:值不能为null。 参数名称:contentRootPath - dotnet ef migrations: Value cannot be null. Parameter name: contentRootPath
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM