views:

32

answers:

2

Hi there,

does anyone know a way to write a Doctrine migration to change the Table Engine of a MySQL Database from MyISAM to InnoDB? Can this be managed via Migrations or do I have to this the old way via SQL-Statements?

+1  A: 

Unfortunately you can only create, rename or delete a table with doctrine migrations.
You will have to do this the old fashioned way :)

Check the Doctrine Documentation.

DuoSRX
A: 

You may want to investigate the 2.0 version of Doctrine Migrations. It would not be compatible with migrations from Doctrine 1.2, but you can use it on any database, without having to use the Doctrine 2 ORM.

Anyway, using this version, it's as simple as:

$this->addSql('ALTER TABLE mytable ENGINE=INNODB');
Bryan M.