Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0
-
Fix Version/s: None
-
Component/s: Mapping Drivers
-
Security Level: All
-
Labels:None
-
Environment:All
Description
We can not set MySql Engine for MyISAM. MySqlPlatform has a _getCreateTableSQL where you can pass some options with the engine param.
Not able to set it up from yml, xml or annotation schema.
I have the same problem and I didn't found documentation to select the engine for a given table.
I tried to understand the code by myself and made modifications of my Doctrine v2.0.5, perhaps this is not the best one but here is a beginning of a solution :
-------------------------------------------------------------------------------
@ ORM\Mapping\Driver\DoctrineAnnotations.php:100
final class Table extends Annotation
{ public $name; public $schema; public $indexes; public $uniqueConstraints; public $engine; }@ ORM\Mapping\Driver\AnnotationDriver.php:144
$primaryTable = array(
'name' => $tableAnnot->name,
'schema' => $tableAnnot->schema,
'engine' => $tableAnnot->engine
);
@ ORM\Tools\SchemaTool.php:133
$table = $schema->createTable($class->getQuotedTableName($this->_platform));
if ( isset($class->table["engine"]) )
$table->addOption("engine",$class->table["engine"]);
-------------------------------------------------------------------------------
...and to define for instance the MyISAM engine in annotations :
/**
*/
Because there is no foreign key on MyISAM tables, there are still problems on the schema creation/update when Doctrine executes the corresponding "alter table" SQL commands.