title: Getting Initial Entity Framework Migrations Script
body: <p>I just installed Entity Framework Migrations, added a property to a class, and gave EF Migrations a whirl.</p>
  
  <p>My development database was promptly updated.  So far, so good.</p>
  
  <p>Now, I want to create a change script for this <em>initial</em> use of Migrations for the production database.  Note there was a pre-existing database because I applied this to an existing project.</p>
  
  <p>The migrations I have are:</p>
  
  <pre><code>PM&gt; Get-Migrations
  Retrieving migrations that have been applied to the target database.
  201204102238194_AutomaticMigration
  201203310233324_InitialCreate
  PM&gt; 
  </code></pre>
  
  <p>I thought I could get a delta script using the following:</p>
  
  <pre><code>Update-Database -SourceMigration:201203310233324_InitialCreate -TargetMigration:201204102238194_AutomaticMigration  -script
  </code></pre>
  
  <p>However, that gives me the error:</p>
  
  <blockquote>
    <p>'201204102238194_AutomaticMigration' is not a valid migration.
    Explicit migrations must be used for both source and target when
    scripting the upgrade between them.</p>
  </blockquote>
  
  <p>Just to see what would happen, I reversed the two parameters (backward migration) and did get the script I would expect after adding the <em>-force</em> flag (new columns dropped).</p>
  
  <p><strong>How can I get a script for this first migration?</strong></p>