Entity framework Core Update-database specific migration

后端 未结 3 1435
Happy的楠姐
Happy的楠姐 2021-02-01 11:49

I am trying to figure out how to run a specific migration from the package manager in nuget.

I have tried to run:

 update-database -TargetMigration test3         


        
3条回答
  •  野的像风
    2021-02-01 12:40

    According to EF Core Docs, correct parameter name is -Target (for EF Core 1.1) or -Migration (for EF Core 2.0)

    so in your case:

    update-database -target test32
    

    or

    update-database -migration test32
    

    "Modern" way is to use "regular" command prompt and .NET Core CLI, and command like dotnet ef database update

提交回复
热议问题