DDC-853: Mysql: Drop schema for entities doesnt work if Database contains already tables with 'enum' Field #5374

doctrinebot opened this Issue Nov 1, 2010 · 2 comments

1 participant


Jira issue originally created by user schnueggel:

Dropping Entities with:

$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
$classes = array(

Doctrine\DBAL\DBALException: Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it

The Database already contains some tables with enum fields. But those should not be affected. They have no constraints to the tables managed by the EntityManager

Some debugging brought me to the point that Doctrine2 is trying to drop complete database, even metaclasses where given.

In Doctrine\ORM\Tools\SchemaTool $classes will not be used in any way

    public function dropSchema(array $classes)
        $dropSchemaSql = $this->getDropSchemaSql($classes);
        $conn = $this->_em->getConnection();

        foreach ($dropSchemaSql as $sql) {
// Here $classes will not be used
    public function getDropSchemaSql(array $classes)
        $sm = $this->_em->getConnection()->getSchemaManager();
        $schema = $sm->createSchema();

        $visitor = new \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector($this->_platform);
        /** @var $schema \Doctrine\DBAL\Schema\Schema **/
        return $visitor->getQueries();

Also method SchemaTool::_getDropSchemaTablesDatabaseMode($classes) seems not to be used.


Comment created by @beberlei:

Fixed, duplicate of DDC-629


Issue was closed with resolution "Duplicate"

@doctrinebot doctrinebot added this to the 2.0-RC1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment