title: Update database schema on model change without data loss
body: <p><strong>Background</strong>: Let's say I'm using the entity framework and one of the entities mapped is given as:</p>
  
  <pre><code>class Foo
  {
      public int ID { get; set; }
      public string Bar { get; set; }
      // other useful properties
  }
  </code></pre>
  
  <p>With the mapping:</p>
  
  <pre><code>class FooMap : EntityTypeConfiguration&lt;Foo&gt;
  {
      // bear me with, I know this is redundant right now
      ToTable("Foo");
      HasKey(e =&gt; e.ID);
      Property(e =&gt; e.ID).HasColumnName("ID");
      Property(e =&gt; e.Bar);
  }
  </code></pre>
  
  <p>Somewhere down the road we need to change the column name of <code>Foo</code> because my boss tells me the <code>Foo</code> needs to have a more extravagant name than <code>ID</code> or else our customers will be unhappy. He tells us to rename it too "FooID":</p>
  
  <pre><code>class FooMap : EntityTypeConfiguration&lt;Foo&gt;
  {
      // bear me with, I know this is redundant right now
      ToTable("Foo");
      HasKey(e =&gt; e.ID);
      Property(e =&gt; e.ID).HasColumnName("FooID"); // Now you map to FooID
      Property(e =&gt; e.Bar);
  }
  </code></pre>
  
  <p>As it stands, if I run this nothing will have changed. The <code>Foo</code> table will still have a column named <code>ID</code> and it'll throw an exception telling me that the column <code>FooID</code> doesn't exist.</p>
  
  <p><strong>The Question</strong>: How can I get the entity framework to recognize that I now wish to update the <code>Foo</code> table so that the column named <code>ID</code> is now named <code>FooID</code>?</p>
  
  <p>More generally, how can I get the entity framework to automatically propagate changes from my code into the actual database (say at the application start up) WITHOUT destroying existing data?</p>
  
  <p>I can't just "Drop and re-create" the database because, for reasons beyond the scope of this question, the database stores some other data in it that isn't created via the models mapped in my code. Dropping it would cause us to lose tables that we can't just recreate using this mechanism.</p>