title: Even though model matches I am getting - Unable to update database to match the current model
body: <ul>
  <li>EF 6.2</li>
  <li>SQL Server 2012</li>
  </ul>
  
  <p>I am getting the exception:</p>
  
  <blockquote>
    <p>Unable to update database to match the current model because there are
    pending changes and automatic migration is disabled...</p>
  </blockquote>
  
  <p>I have done my research <a href="https://8thlight.com/blog/zack-davy/2015/09/18/entity-framework-in-distributed-teams.html" rel="noreferrer">here</a>, <a href="https://stackoverflow.com/questions/43156475/unable-to-update-database-to-match-the-current-model-because-there-are-pending-c">here</a>, <a href="http://robertgreiner.com/2012/05/unable-to-update-database-to-match-the-current-model-pending-changes/" rel="noreferrer">here</a></p>
  
  <p>I have had a solution working for a long time now with no issues. And in fact I made a change to the database a couple of days ago and all was well using the standard <code>add-migration</code> followed by <code>update-database</code> with no issues.</p>
  
  <p>However today I made a change to the database again and did <code>add-migration</code> followed by <code>update-database</code>. But when I run the application I get the above error.</p>
  
  <p>I make sure the migrations run by including the following in my Application_Start:</p>
  
  <pre><code>ConfigurationPlatform configurationPlatform = new ConfigurationPlatform();
  DbMigrator migratorPlatform = new DbMigrator(configurationPlatform);
  migratorPlatform.Update();
  </code></pre>
  
  <p>and the configuration class looks as follows:</p>
  
  <pre><code>public sealed class ConfigurationPlatform : DbMigrationsConfiguration&lt;TreasurePlatformDbContext&gt;
  {
      public ConfigurationPlatform()
      {
          AutomaticMigrationsEnabled = false;
          AutomaticMigrationDataLossAllowed = false;
          ContextKey = "TreasurePlatform";
      }
  
      protected override void Seed(TreasurePlatformDbContext aContext)
      {
          // This method will be called every time after migrating to the latest version.
          // You can add any seed data here...
      }
  }
  </code></pre>
  
  <p>I have also tried:</p>
  
  <ul>
  <li>Running add-migration again but it produces NO changes</li>
  <li>Turning on automatic migrations and it STILL complains</li>
  </ul>
  
  <p>I am confident the POCO table models match what is in the database. Has anyone got any suggestions or thinks I can try?</p>