title: Doctrine Migrations with Symfony 3 addIndex not found. Why?
body: <p>I've inherited a Symfony 3 project that had no migrations. </p>
  
  <p>Following the <a href="https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html" rel="nofollow noreferrer">documentation</a>, I added Doctrine Migrations Bundle to Symfony.</p>
  
  <pre><code>$ composer require doctrine/doctrine-migrations-bundle "^1.0"
  </code></pre>
  
  <p>Added the configuration to config.yml</p>
  
  <pre><code>doctrine_migrations:
      dir_name: "%kernel.root_dir%/DoctrineMigrations"
      namespace: Application\Migrations
      table_name: migration_versions
      name: Application Migrations
  </code></pre>
  
  <p>Then added the loader to appKernel.php</p>
  
  <pre><code>new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
  </code></pre>
  
  <p>The console now shows doctrine:migrations:* as available features, so I then generated my migration file</p>
  
  <pre><code>php bin/console doctrine:migrations:generate 
  Generated new migration class to "/path/to/project/app/DoctrineMigrations/Version20100621140655.php"
  </code></pre>
  
  <p>Then continued following along with the <a href="http://docs.doctrine-project.org/projects/doctrine1/en/latest/en/manual/migrations.html" rel="nofollow noreferrer">Doctrine migrations documentation</a>:</p>
  
  <pre><code>public function up(Schema $schema)
  {
      // alter my table
      $options = ['fields' =&gt; ['type_id']];
      $schema-&gt;addIndex('advertiser', 'idx_type_id', $options);
      ...
  }
  </code></pre>
  
  <p>Now, when I run the migration:</p>
  
  <pre><code>Migrating up to 20170714165306 from 20170714155549
  
  ++ migrating 20170714165306
  
  [Symfony\Component\Debug\Exception\UndefinedMethodException]                                                                                                                
  Attempted to call an undefined method named "addIndex" of class "ProxyManagerGeneratedProxy\__PM__\Doctrine\DBAL\Schema\Schema\Generatedaca9b50393335f8354881e485c485329".  
  </code></pre>
  
  <p>Now when I got that error, I searched on that and found ocramius/ProxyManager. I installed that with</p>
  
  <pre><code>composer require ocramius/proxy-manager "^2.0"
  </code></pre>
  
  <p>Still got the same error.</p>
  
  <p>Granted, in most of the Doctrine Migrations documentation, I see mainly <code>addSql( 'ALTER TABLE ...')</code> type statements, but I want to use the wrapper methods <code>addIndex</code>, <code>removeIndex</code>, etc.</p>
  
  <p>Can someone explain how to get these features working?</p>