title: Why does Add-Migration sometimes create duplicate migrations?
body: <p>I am facing a weird problem with code first migrations in Entity Framework version 5. Sometimes <code>Update-Database</code> fails due to pending changes but <code>Add-Migration</code> command only produces migrations with database changes already contained in the last migrations and the database is up-to-date. Therefore I'd expect the new migration to be empty.</p>
  
  <p>How does <code>Add-Migration</code> detect what changes are due? It doesn't seem to use the database as a source.</p>