yiiyii-components

Run single migration (not newest) in Yii


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.


Solution

  • 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