Skip to content

Loading…

DDC-629: SchemaTool's method dropSchema, drops all classes instead of those specified in $classes argument #5138

Closed
doctrinebot opened this Issue · 4 comments

2 participants

@doctrinebot

Jira issue originally created by user sammysnake:

$classes = array(
  $this->_em->getClassMetadata('Models\Acl\Role'),
  $this->_em->getClassMetadata('Models\Acl\Resource\Module'),
  $this->_em->getClassMetadata('Models\Acl\Resource\Controller'),
  $this->_em->getClassMetadata('Models\Acl\Resource\Action')
);

// Delete databases
$tool = new \Doctrine\ORM\Tools\SchemaTool($this->_em);
$tool->dropSchema($classes);

Expected:
Drops just schema specified by $classes

Actual:
Drops all schema, not just that specified in $classes

@doctrinebot

Comment created by sammysnake:

SchemaTool.php method getDropSchemaSql(array $classes)

doesn't create $schema from $classes argument
$schema = $sm->createSchema();

Additionally in AbstractSchemaManager.php method createSchema() ..

doesn't support creating schema from argument ($classes)

@doctrinebot

Comment created by @beberlei:

yeah i think this is a non-issue, but requires better documentation and a disctiction of th etwo different approaches to deleting tables through totally different method names. I will be on this issue :)

@doctrinebot

Comment created by @beberlei:

fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-RC1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.