I read the CDbMigration class docs and sources and it seems that it’s not possible to run custom SQL commands, such as creating a view or a stored procedure or making complex updates with multiple joins.
Well, almost every CDBMigration method is also available in CDBConnection class, but the CDBMigration ones add some nice info. What I’d like to have is very simple, i.e. to add to CDBMigration a method like this:
public function executeStmt($stmt)
{
echo " > executing statement $stmt ...";
$time=microtime(true);
$this->getDbConnection()->createCommand($stmt);
echo " done (time: ".sprintf('%.3f', microtime(true)-$time)."s)\n";
}