Run single migration (not newest) in Yii

Thomas picture Thomas · Feb 22, 2014 · Viewed 9.5k times · Source

I have few migrations files.How can I run single migration down or up, if this migration isn't the newest, but some steps in the migrations history?

When I run yiic migrate up 1, it runs the latest migration. Running migration command using migration version as parameter also doesn't help.

Answer

phemios picture phemios · Feb 22, 2014

Please check documentation about redoing-migrations section:

yiic migrate redo [step]

If you want to undo/redo only one specific migration in your migration history. You have to modify your migration history :

yiic migrate mark 101129_185401
yiic migrate redo