title: Doctrine schema update/migration error: unique index
body: <p>I've found similar questions but they were in the app, mine relates to the cli commands, i.e. <code>php app/console doctrine:schema:update --force</code> or <code>php app/console doctrine:migrations:migrate</code></p>
  
  <p>Error:</p>
  
  <pre><code>Migration 20130112151503 failed during Execution. Error An exception occurred wh
  ile executing 'CREATE UNIQUE INDEX UNIQ_68D3801E989D9B62 ON artists (slug)':
  
  
  
      SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key
       'UNIQ_68D3801E989D9B62'
  
  
  
  
    [Doctrine\DBAL\DBALException]
    An exception occurred while executing 'CREATE UNIQUE INDEX UNIQ_68D3801E989
    D9B62 ON artists (slug)':
  
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' fo
    r key 'UNIQ_68D3801E989D9B62'
  </code></pre>
  
  <p>I was really hoping that migrations would take care of this error, but alas. How do I resolve this issue, e.g. I would only be able to run the migrations command on the live server. Why doesn't the migration first drop the unique index if exists? Or why doesn't it detect there is already an unique index?</p>