Entity Framework always has pending migration
<p>Using Entity Framework 6, with a SQL Server database and code first migrations, I have migrations set up and running "happily", however I'm finding that every time I go to add another migration I get the following error first off:</p>

<blockquote>
  <p>Unable to generate an explicit migration because the following explicit migrations are pending: [201602090629398_Initial, 201602090638322_FixSitePageColumns, 201602110313468_RemoveRequiredTemplateId]. Apply the pending explicit migrations before attempting to generate a new explicit migration."</p>
</blockquote>

<p>If I run <code>update-database -force</code> it complains (naturally) that the script fails because of already having been applied.  A strange combination of doign this again and then the <code>add-migration</code> works and I can carry on updating to the latest migration.</p>

<p>The list of "pending" migrations also grows with every addded migration over time.</p>

<p>What could cause this "pending" state, when the migration HAS already been applied?  I can confirm that the database has already been updated, the migration exists in <code>__MigrationHistory</code>, and the program is running along happily.</p>

<p><strong>EDIT</strong></p>

<p>I've also just run <code>get-migrations</code> and the following is being returned:</p>

<blockquote>
  <p>PM> get-migrations
  Retrieving migrations that have been applied to the target database.
  201602110313468_RemoveRequiredTemplateId
  201602110311536_RemoveRequiredTemplateId
  201602090638322_FixSitePageColumns
  201602090629398_Initial</p>
</blockquote>

<p>The weird thing here (possibly a red herring) is that <code>201602110311536_RemoveRequiredTemplateId</code> is not a migration in my project, I think it may have been one that I created and then deleted, I didn't ever implicitly apply it to the database but it's in the <code>__MigrationHistory</code> table.</p>