title: Update model snapshot of last migration in Entity Framework and reapplying it
body: <p>I'm using <strong>EF6</strong> code-first migrations for existing database but initial <code>DbContext</code> does not fully cover existing schema (since it's massive). So from time to time I have to make updates to the model in <em>database-first</em> style. For example when I need an entity mapping for a table or a column that is already in the database but not reflected in the code I do the following:</p>
  
  <ol>
  <li>Make all change (add new entity, rename the column mapping or add new property)</li>
  <li>Scaffold migration representing the latest model snapshot <code>stub_migration</code></li>
  <li>Copy-paste latest serialized model from <code>stub_migration</code> to the <code>last_migration</code> resource file</li>
  <li>Delete <code>stub_migration</code></li>
  <li>Revert <code>last_migration</code> in database</li>
  <li><code>Update-Database</code> so that model snapshot in <code>[__MigrationHistory]</code> table would be also updated</li>
  </ol>
  
  <p>I understand that this aproach is a bit hackish and the proper way would be to leave empty <code>stub_migration</code> but this would force lots of empty migrations which I would rather avoid.</p>
  
  <p>Looking at a similar scenario from <a href="https://msdn.microsoft.com/en-us/data/dn481501.aspx" rel="nofollow">MSDN article (Option 2: Update the model snapshot in the last migration)</a> I wouldn't imagine that there is an easier way rather than writing power shell script, managed code or both to make it work. But I would rather ask community first before diving deep into it.
  So I wonder: <strong>is there a simple way to automate generation of new model snapshot in latest migration and reaplying it?</strong> </p>