What is the reverse for Update-Database (used in Package Manager Console)?

entity-framework nuget nuget-package

Question

After realizing that I needed to create an index and downgrade to the previous state, I changed my domain classes and ran Update-Database in the Package Manager Console. What is the correct command to migrate one step backwards?

1
19
11/16/2013 4:37:18 PM

Accepted Answer

You can update to a specific migration by using the TargetMigration option of the Update-Database command. With that, you can upgrade or downgrade.

Update-Database –TargetMigration PreviousMigrationName
30
11/16/2013 6:33:44 PM

Popular Answer

Update-Database –TargetMigration "lastcreatedMigrationName"

example:

update-database -targetmigration: "entity-logs-index"


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow