This is an extension of base Migration Command to provide functionality to have migrations in modules and apply/undo those migrations modules wise.
- Put the SMigrationCommand.php file to ~protected/commands folder.
- add below snippet to ~config/console.php.
return array( ... ... 'commandMap' => array( 'migrate' => array( 'class' => 'application.commands.SMigrationCommand', ) ), ...
Always put normal migration scripts in ~protected/migrations folder and module migrations in ~protected/modules/nameofmodule/migrations.
now open CMD/terminal CD to ~protected. invoke command yiic migrate [up|down] [...] for normal migrations AND yiic migrate module [up|down] [...] for module migrations
Only migrate create,migrate up and migrate down is working currently. Will upgrade gradually.