title: Code First Migrations - Update-database -script command generated SQL script not working
body: <p>I have to created a database through Entity Framework 5 with the following model:</p>
  
  <pre><code>public class Post
  {
          public int PostId { get; set; }
          [MaxLength(200)]
          public string Title { get; set; }
          public string Content { get; set; }
  
          public int BlogId { get; set; }
          public Blog Blog { get; set; }
  }
  </code></pre>
  
  <p>Then I have added new property in <code>Post</code></p>
  
  <pre><code>public string Abstract { get; set; }
  </code></pre>
  
  <p>then I have run </p>
  
  <pre><code>Add-Migration AddPostAbstract
  </code></pre>
  
  <p>which created the following class in my <code>Migrations</code> folder, after that I have modified this file by adding one more SQL statement </p>
  
  <pre><code>//201308300714477_AddPostAbstract.cs
  public override void Up()
  {
                  AddColumn("dbo.Posts", "Abstract", c =&gt; c.String());
                  Sql("UPDATE dbo.Posts SET Abstract = LEFT(Content, 100) WHERE Abstract IS NULL");
  }
  
  public override void Down()
  {
      DropColumn("dbo.Posts", "Abstract");
  }
  </code></pre>
  
  <p>After that I have executed this command </p>
  
  <pre><code>Update-Database –Verbose
  </code></pre>
  
  <p>which updated my database and also returned this SQL query:</p>
  
  <pre><code>ALTER TABLE [dbo].[Posts] ADD [Abstract] [nvarchar](max)
  UPDATE dbo.Posts SET Abstract = LEFT(Content, 100) WHERE Abstract IS NULL
  </code></pre>
  
  <p>Now I have deleted <code>Abstract</code> column from table and tried to execute the above query manually in SQL at that time it show me following error.</p>
  
  <blockquote>
    <p>Msg 207, Level 16, State 1, Line 2<br>
    Invalid column name 'Abstract'.</p>
  </blockquote>
  
  <p>My question is  why this query is not executed in SQL even this query is generated through migration?</p>
  
  <p>Or is there any way to run such multiple query through migration generated script.</p>