title: Database applies ALL previous migrations on update and NOT just the new one
body: <p>I'm developing a website which, as of current, both has a production and a test database.
  The production database is hosted externally while the test database is hosted locally.</p>
  
  <p>Whenever I make changes to my database I apply the changes through a migration.
  After having added a new migration I run the <strong>update-database</strong> command on both my production and test database to keep them in sync.</p>
  
  <p>I applied the migration just fine to my production database, however, when I wanna apply the migration to my test database I see that it attempts to apply ALL the previous migrations (and not just the new one):</p>
  
  <p>Here is the output:</p>
  
  <blockquote>
    <p>Applying explicit migrations: [201603230047093_Initial,
    201603232305269_AddedBlobNameToImage,
    201603242121190_RemovedSourceFromRealestateDbTable,
    201603311617077_AddedSourceUrlId,
    201604012033331_AddedIndexProfileAndFacebookNotifications,
    201604012233271_RemovedTenantIndexProfile,
    201604042359214_AddRealestateFilter]. Applying explicit migration:
    201603230047093_Initial. System.Data.SqlClient.SqlException
    (0x80131904): There is already an object named 'Cities' in the
    database.</p>
  </blockquote>
  
  <p>Obviously it fails since the current state of the database is at the second latest migration. However I wonder why it attempts to apply ALL the previous migrations?</p>
  
  <p>Unlike the production database (which has had all the migrations applied one at a time), the test database was deleted and created at the previous migration so its migration history table only contains one row:</p>
  
  <pre><code>201604012239054_InitialCreate 
  </code></pre>
  
  <p>(I assume InitialCreate is an auto generated name of all the previous migrations combined).</p>
  
  <p><strong>In summary:</strong></p>
  
  <p><em>Why is the test database trying to apply ALL the previous migrations instead of just the newly added?</em></p>
  
  <p>EDIT:
  When running COMMMAND I get the follow output script:</p>
  
  <pre><code>DECLARE @CurrentMigration [nvarchar](max)
  
  IF object_id('[dbo].[__MigrationHistory]') IS NOT NULL
      SELECT @CurrentMigration =
          (SELECT TOP (1) 
          [Project1].[MigrationId] AS [MigrationId]
          FROM ( SELECT 
          [Extent1].[MigrationId] AS [MigrationId]
          FROM [dbo].[__MigrationHistory] AS [Extent1]
          WHERE [Extent1].[ContextKey] = N'Boligside.Migrations.Configuration'
          )  AS [Project1]
          ORDER BY [Project1].[MigrationId] DESC)
  
  IF @CurrentMigration IS NULL
      SET @CurrentMigration = '0'
  
  IF @CurrentMigration &lt; '201603230047093_Initial'
  </code></pre>
  
  <p>(it proceeds making if statements for each previous migration)</p>
  
  <p>The current migrations table in my database looks the following (note that the first row is for a logging framework so it's not related):
  <a href="https://i.stack.imgur.com/KusUe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KusUe.png" alt="enter image description here"></a></p>