Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDC-46: Invalid MySQL column mappings #4962

Closed
doctrinebot opened this issue Oct 14, 2009 · 4 comments
Closed

DDC-46: Invalid MySQL column mappings #4962

doctrinebot opened this issue Oct 14, 2009 · 4 comments
Labels

Comments

@doctrinebot
Copy link

Jira issue originally created by user mcurcio:

I have a table for storing sessions in the database, schema is:

CREATE TABLE IF NOT EXISTS Session (
id varchar(255) NOT NULL,
data longtext NOT NULL,
created datetime NOT NULL,
accessed datetime NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

With the following code, I receive an error about an unknown 'clob' column. I believe the issue is related to the mappings in DBAL/Schema/MySQLSchemaManager::_getPortableTableColumnDefinition

Code:
$cmf = $em->getMetadataFactory();
$driver = $em->getConfiguration()->getMetadataDriverImpl();

    $driver->setClassDirectory(<model_path>);

    $classes = array();
    $preloadedClasses = $driver->preload();
    foreach ($preloadedClasses as $className) {
        $classes[] = $cmf->getMetadataFor($className);
    }

    $schemaTool = new \Doctrine\ORM\Tools\SchemaTool($em);

foreach ($schemaTool->getUpdateSchemaSql($classes) as $sql) {
        echo $sql.'<br />';
    }

Error:
exception 'Doctrine\Common\DoctrineException' with message 'Unknown column type ('clob')' in /var/www/tec-expo.com/development/libraries/Doctrine/Common/DoctrineException.php:109
Stack trace:
#0 [internal function]: Doctrine\Common\DoctrineException::**callStatic('unknownColumnTy...', Array)
#1 libraries/Doctrine/DBAL/Types/Type.php(125): Doctrine\Common\DoctrineException::unknownColumnType('clob')
#2 libraries/Doctrine/DBAL/Schema/AbstractSchemaManager.php(871): Doctrine\DBAL\Types\Type::getType('clob')
#3 libraries/Doctrine/DBAL/Schema/AbstractSchemaManager.php(180): Doctrine\DBAL\Schema\AbstractSchemaManager->_getPortableTableColumnList(Array)
#4 libraries/Doctrine/ORM/Tools/SchemaTool.php(504): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableColumns('Session')
#5 (MVC controller): Doctrine\ORM\Tools\SchemaTool->getUpdateSchemaSql(Array)

@doctrinebot
Copy link
Author

Comment created by romanb:

This should be fixed now in HEAD. Can you confirm that?

@doctrinebot
Copy link
Author

Comment created by @jwage:

Which metadata driver are you using?

@doctrinebot
Copy link
Author

Comment created by mcurcio:

Yes, it appears to be fixed now.

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant