DB migration & custom SQL

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.

Is this a planned improvement?

Thanks for attention

If i understand migration correctly … then it is just like a alter table command with version control (up- and downgrading).

So why you need Joins and views?

For the views use a VCS like git or SVN.

The migration gives you access to the DB connection, so really you can do anything in a migration that you could normally do with a CDBConnection.

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";


}

This is already implemented in svn trunk and will be available in 1.1.7.

Great! Sorry, I should have checked the issue tracker before posting.