title: How can I perform database migration using Entity Framework 4.2?
body: <p>I'm just starting to dive into ASP.net MVC3. I come from a Django background. One of the things I love about Django, is the add-on called "South". It lets me modify my Models in code, and then I run a command, it figures out what has changed, and it updates the database accordingly.</p>
  
  <p>If I add, remove, or rename a field with the "code-first" approach in EF4, what happens? Does it just add or remove the field, and that's it? What if I want to do something like add a new field, and then perhaps run a Linq-to-SQL query to populate the new field, and <em>then</em> remove the old field? <em>And</em> I want a record of this so that when I go to deploy the change on my production server, it will run those 3 commands in sequence.</p>
  
  <p>Is there something like that? Or how do people tackle situations like this? (It is pretty common...)</p>
  
  <hr>
  
  <p><strong>Edit:</strong> Found some links.</p>
  
  <ul>
  <li><a href="https://softwareengineering.stackexchange.com/questions/76082/is-entity-framework-code-first-a-bit-meaningless-useless-in-production-and-what">https://softwareengineering.stackexchange.com/questions/76082/is-entity-framework-code-first-a-bit-meaningless-useless-in-production-and-what</a></li>
  <li><a href="http://blogs.msdn.com/b/efdesign/archive/2010/10/22/code-first-database-evolution-aka-migrations.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/efdesign/archive/2010/10/22/code-first-database-evolution-aka-migrations.aspx</a></li>
  <li><a href="https://stackoverflow.com/q/5870037/65387">Using EF4 Code First: How can I change the Model without losing data</a></li>
  <li><a href="https://stackoverflow.com/q/5861991/65387">Deploying database changes with EF 4.1</a></li>
  <li><a href="https://github.com/dradovic/MigSharp" rel="nofollow noreferrer">https://github.com/dradovic/MigSharp</a></li>
  <li><a href="http://blogs.msdn.com/b/adonet/archive/2011/09/21/code-first-migrations-alpha-3-with-magic-walkthrough-automatic-migrations.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/adonet/archive/2011/09/21/code-first-migrations-alpha-3-with-magic-walkthrough-automatic-migrations.aspx</a> (Woo!)</li>
  </ul>