How to unapply a migration in ASP.NET Core with EF Core

前端 未结 16 2281
余生分开走
余生分开走 2020-12-07 08:10

When I run PM> Remove-Migration -context BloggingContext in VS2015 with an ASP.NET Core project using EF Core I get the following error:

Syst         


        
16条回答
  •  死守一世寂寞
    2020-12-07 08:44

    To revert all the migrations which are applied to DB simply run:

    update-database 0
    

    It should be followed with running Remove-Migration as many times as there are migration files visible in the Migration directory. The command deletes the latest migration and also updates the snapshot.

提交回复
热议问题