title: symfony doctrine schema create
body: <p>I am in the test files, and I want to launch some symfony commands namely a database followed by a drop followed by a create i create schema:</p>
  
  <pre><code>public function runCommand(Client $client, $command)
  {
      $application = new Application($client-&gt;getKernel());
      $application-&gt;setAutoExit(false);
  
      $fp = tmpfile();
      $input = new StringInput($command);
      $output = new StreamOutput($fp);
  
      $application-&gt;run($input, $output);
  
      fseek($fp, 0);
      $output = '';
      while (!feof($fp)) {
          $output = fread($fp, 4096);
      }
      fclose($fp);
  
      return $output;
  }
  </code></pre>
  
  <p>public function cleanDataBaseTest()
      {</p>
  
  <pre><code>    $client = self::createClient();        
  
      $command_drop_database = $this-&gt;runCommand($client, 'doctrine:database:drop --env=test --force');
  
      $command_create_database = $this-&gt;runCommand($client, 'doctrine:database:create --env=test');
  
      $command_create_schema = $this-&gt;runCommand($client, 'doctrine:schema:create --dump-sql');
  
      echo $command_create_schema;
    /*
      ALTER TABLE.....
  
  */
  
  }
  </code></pre>
  
  <p>or when I do a echo $ command_create_schema, I only alter table.</p>
  
  <pre><code>    C6 FOREIGN KEY (akey) REFERENCES atable (id);
  ALTER TABLE atablea ADD CONSTRAINT FK_646DFFB72576E0FD FOREIGN KEY (anid) REFERENCES ....
  </code></pre>
  
  <p>So if I'm doing command: php app / console doctrine: schema: create - dump-sql I get the create and alter table</p>
  
  <p>Do you know why ?</p>