简体   繁体   中英

Entity Framework migrations remove and update does not work

Entity Framework migration add works perfectly but the migrations remove and update does not work. What's the problem?

dotnet --version
2.1.202

Entity Framework Core .NET Command Line Tools 2.0.0-rtm-26452.

You can rollback to any migration by using:

Update-Database -TargetMigration:"MigrationName"

For example:

Update-Database -configuration YourProject.Migrations.Configuration -Verbose -
TargetMigration:"201903291233013_migration_001"

In addition to that you can also delete the migration.cs and its record from MigrationHistory table. Hope this helps...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM