private function runMigrationTool(array $dsn)
    {
        $runner=new CConsoleCommandRunner();
        $runner->commands=array(
            'migrate' => array(
                'class' => 'application.commands.CiiMigrateCommand',
                'dsn' => $dsn,
                'interactive' => 0,
            ),
            'db'=>array(
                'class'=>'CDbConnection',
                'connectionString' => "mysql:host={$dsn['host']};dbname={$dsn['dbname']}",
                'emulatePrepare' => true,
                'username' => $dsn['username'],
                'password' => $dsn['password'],
                'charset' => 'utf8',
            ),
        );
        
        ob_start();
        $runner->run(array(
            'yiic',
            'migrate'
        ));
        
        return htmlentities(ob_get_clean(), null, Yii::app()->charset);
    }