Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.4
-
Fix Version/s: 2.2
-
Component/s: Schema Managers
-
Labels:None
-
Environment:Windows 7 x64, PHP 5.3.1, MySQL 5.1.36 (pdo_mysql driver)
Description
MySQL BLOB datatype appears to be breaking ClassMetadataExporter. Very new to Doctrine so hopefully I've isolated this correctly.
CREATE TABLE foo (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
bar BLOB,
PRIMARY KEY (id)
) ENGINE=InnoDB;
// ... setup entitymanager .... $cme = new \Doctrine\ORM\Tools\Export\ClassMetadataExporter(); $sm = $em->getConnection()->getSchemaManager(); $cme->addMappingSource($sm, 'database'); $metadatas = $cme->getMetadatasForMappingSources(); $exporter = $cme->getExporter('annotation', '/path/to/annotations'); $exporter->setMetadatas($metadatas); $exporter->export();
php -f doctrine Orm:convert-mapping --from-database --to=annotation --dest C:\www\app\models
Fatal error: Uncaught exception 'Doctrine\Common\DoctrineException' with message 'Unknown column type' in C:\www\app\lib\Doctrine\Common\DoctrineException.php:112
Stack trace:
#0 [internal function]: Doctrine\Common\DoctrineException::__callStatic('unknownColumnTy...', Array)
#1 C:\www\app\lib\Doctrine\DBAL\Types\Type.php(125): Doctrine\Common\DoctrineException::unknownColumnType('blob')
#2 C:\www\app\lib\Doctrine\DBAL\Schema\MySqlSchemaManager.php(262): Doctrine\DBAL\Types\Type::getType('blob')
#3 C:\www\app\lib\Doctrine\DBAL\Schema\AbstractSchemaManager.php(802): Doctrine\DBAL\Schema\MySqlSchemaManager->_getPortableTableColumnDefinition(Array)
#4 C:\www\app\lib\Doctrine\DBAL\Schema\AbstractSchemaManager.php(221): Doctrine\DBAL\Schema\AbstractSchemaManager->_getPortableTableColumnList(Array)
#5 C:\www\app in C:\www\app\lib\Doctrine\Common\DoctrineException.php on line 112
You did isolate it correctly, we haven't gotten around to support BLOBs yet, because they are very complex to handle across different database vendors.
We probably should address this asap though for beta 2.