CDbMigration update

Hi guys,

We try to update some record in db at migration, but it fails different ways.

What we want to do is:




update category set rgt = right + 2



It try to insert ‘rgt + 2’ as string:


$this->update('category', array('rgt'=>new CDbExpression('rgt + 2')))

It try to insert ‘rgt + 2’ as string also:


$this->update('category', array('rgt'=>':rgt'),'',array(':rgt'=>new CDbExpression('rgt + 2')))

How can we do it with CDbMigration?

Why not just this?


$this->execute('UPDATE category SET rgt=right+2');

It was our idea too, but we thought it’s maybe a bug. Thx for the reply