title: DbMigrator trying to execute every migration, not detecting executed migrations
body: <p>I am trying to create a service call that will update an EF code first database to the latest version. However, it is always trying (and failing obviously) to execute all migrations, whether they were executed already or not.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>        var config = new DbMigrationsConfiguration&lt;MyContext&gt;();
          config.MigrationsAssembly = typeof (MyContext).Assembly;
          config.MigrationsNamespace = "Context.Migrations";
  
          //This had no effect
          //config.SetHistoryContextFactory(connectionString.ProviderName, (connection, s) =&gt; new HistoryContext(context.Database.Connection, "dbo"));
          var migrator = new DbMigrator(config);
  
          //This gets every single migration, even the ones already executed before
          var migrations = migrator.GetPendingMigrations();
          //This gets 0 migrations
          var existing = migrator.GetDatabaseMigrations();
          //This gets all migrations
          var other = migrator.GetLocalMigrations();
  
          //This returns true! So it knows all the migrations are already executed
          var differ = context.Database.CompatibleWithModel(true);
          //This will throw an exception because it's trying to create existing tables!
          migrator.Update();
  </code></pre>
  
  <p>I can confirm that the migration history table contains [dbo].[__MigrationHistory] references all the old migrations.</p>
  
  <p>I checked the connection strings in the migrator. I also tried setting the history context factory manually in case it is looking somewhere else with no result. Also, running update-database directly from the console works and says no pending updates.</p>
  
  <p>Any help is appreciated</p>