This looks like a really common task, but I can\'t find an easy way to do it.
I want to undo the last applied migration. I would have expected a simple command, lik
I realised there aren't any good solutions utilizing the CLI dotnet
command so here's one:
dotnet ef migrations list
dotnet ef database update NameOfYourMigration
In the place of NameOfYourMigration
enter the name of the migration you want to revert to.
EF CORE
PM> Update-Database yourMigrationName
(reverts the migration)
PM> Update-Database
worked for me
in this case the original question (yourMigrationName = CategoryIdIsLong)
The solution is:
Update-Database –TargetMigration 201609261919239_yourLastMigrationSucess
It's working for me.
Syntax Update-Database
Example Update-Database 20200903061032_AddNewFieldInCreditHistoryAndLogs
update-database 0
Warning: This will roll back ALL migrations in EFCore! Please use with care :)
Update-Database –TargetMigration:"Your migration name"
For this problem I suggest this link:
https://elegantcode.com/2012/04/12/entity-framework-migrations-tips/