我正在尝试从nuget的包管理器中找出具体的迁移方法。
I am trying to figure out how to run a specific migration from the package manager in nuget.
我尝试运行:
update-database -TargetMigration test32但是我确实得到了以下消息:
But I do get this message:
找不到与参数名称'TargetMigration'匹配的参数。
A parameter cannot be found that matches parameter name 'TargetMigration'.
我从Microsoft文档中了解到该命令到以前的ef版本。
I read about that command from Microsoft's documentation to a previous ef version.
因此,我不确定它在ef内核中如何。
So I am not sure how it is in ef core.
推荐答案根据 EF核心文档,正确的参数名称为 -Target (对于EF Core 1.1)或 -Migration (对于EF Core 2.0)
According to EF Core Docs, correct parameter name is -Target (for EF Core 1.1) or -Migration (for EF Core 2.0)
所以在您的情况下:
update-database -target test32或
update-database -migration test32现代方式是使用常规命令提示符和。NET Core CLI ,并使用 dotnet ef数据库更新< target>
"Modern" way is to use "regular" command prompt and .NET Core CLI, and command like dotnet ef database update <target>
更多推荐
实体框架核心更新
发布评论