title: Importing tables from external database in Symfony2 with doctrine
body: <p>I have a Symfony2 project with its own database, and now I want to connect to another database (another project) so I can modify some tables.</p>
  
  <p>I created the new connection in <code>config_dev.yml</code></p>
  
  <pre><code>doctrine:
      dbal:
          default_connection: default
          connections:
              default:
                  driver:   pdo_mysql
                  host:     localhost
                  dbname:   database1
                  user:     root
                  password: 
              buv:
                  driver:   pdo_mysql
                  host:     localhost
                  dbname:   database2
                  user:     root
                  password:
  </code></pre>
  
  <p>I tried to import the schema with the following command:</p>
  
  <pre><code>$ php app/console doctrine:mapping:import --em=buv MyBundle yml
  </code></pre>
  
  <blockquote>
    <p>[Doctrine\DBAL\Schema\SchemaException]
        Index '' does not exist on table 'old_table'</p>
  </blockquote>
  
  <p>But some of the tables in database2 have no PKs! And the full import dosn't work. But I only want to import two tables, so I tried:</p>
  
  <pre><code>$ php app/console doctrine:mapping:import --em=buv --filter="tablename" MyBundle yml
  </code></pre>
  
  <p>But I'm getting the same error, seems that --filter isn't working.</p>
  
  <p>The documentation in the console command <code>doctrine:mapping:import</code> only says to put the entity name in the filter option. But I don't have an entity yet.</p>