Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-629

SchemaTool's method dropSchema, drops all classes instead of those specified in $classes argument

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.0-RC1
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None
    • Environment:
      Ubuntu, PHP 5.3.2, MySQL

      Description

      $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

        Activity

        Hide
        Joshua Henn added a comment -

        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)

        Show
        Joshua Henn added a comment - 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)
        Hide
        Benjamin Eberlei added a comment -

        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

        Show
        Benjamin Eberlei added a comment - 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
        Hide
        Benjamin Eberlei added a comment -

        fixed

        Show
        Benjamin Eberlei added a comment - fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Joshua Henn
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: