Ilan
Ilan

Reputation: 1737

How do I use EF5 migrate.exe to rollback a code first migration?

I am trying to figure out the commandline line params for the EF5 migrate.exe that will allow me to manually roll back the latest code-first migration - i.e. to apply the Down() function in the latest DbMigration.

NB I have migrate.exe working - I can apply the Up() function - but I don't see any documentation about rollback on the migrate.exe help page: http://msdn.microsoft.com/en-us/data/jj618307.aspx

Anyone know whether this is possible?

Upvotes: 3

Views: 1675

Answers (1)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364249

Use targetMigration parameter and set it to name of the migration you want to end with. If it is old migration the tool should revert all migrations applied after your selected migration. At least this is how it works in powershell commands.

Upvotes: 4

Related Questions