As of EF 5.0, the approach you describe is the preferred way. One solution would be to create a wrapper PS script that automates the steps above. Additionally, feel free to create a feature request for this, or better yet, take a shot at implementing it! http://entityframework.codeplex.com/
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, like
PM> Update-Database -TargetMigration:"-1"
Instead, all I can come up with is:
Retrieving migrations that have been applied to the target database.
PM> Update-Database -TargetMigration:"CategoryIdIsLong"
(At least I can use just the name, skipping the timestamp...)
Is there an easier way?
2 Answers0 Corrected Answers
where 20161012160749_AddedOrderToCourse is a name of migration you want to rollback to.