首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在具有EF核心的ASP.NET核心中取消应用迁移

如何在具有EF核心的ASP.NET核心中取消应用迁移
EN

Stack Overflow用户
提问于 2016-07-05 05:29:51
回答 12查看 290K关注 0票数 303

当我在使用EF核心的ASP.NET核心项目中运行VS2015中的PM> Remove-Migration -context BloggingContext时,我得到以下错误:

代码语言:javascript
复制
System.InvalidOperationException: The migration '20160703192724_MyFirstMigration' has already been applied to the database. Unapply it and try again. If the migration has been applied to other databases, consider reverting its changes using a new migration.    at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.RemoveMigration(String projectDir, String rootNamespace, Boolean force) 
    at Microsoft.EntityFrameworkCore.Design.MigrationsOperations.RemoveMigration(String contextType, Boolean force) 
    at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsRemoveCommand.<>c__DisplayClass0_0.<Configure>b__0() 
    at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) 
    at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args) 
 The migration '20160703192724_MyFirstMigration' has already been applied to the database. Unapply it and try again. If the migration has been applied to other databases, consider reverting its changes using a new migration.

如何取消应用它?我使用的是ASP.NET核心1.0、EF核心和VS2015更新3的最新版本。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38192450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档