Как отменить миграцию в ASP.NET Core с помощью EF CoreC#

Место общения программистов C#
Anonymous
Как отменить миграцию в ASP.NET Core с помощью EF Core

Сообщение Anonymous »

Когда я запускаю PM> Remove-Migration -context BloggingContext в VS2015 с проектом ASP.NET Core с использованием EF Core, я получаю следующую ошибку:

Код: Выделить всё

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.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 Core 1.0, EF Core и VS2015 Update 3.


Подробнее здесь: https://stackoverflow.com/questions/381 ... th-ef-core

Вернуться в «C#»