title: Unable to run EF5 migration with existing database
body: <p>First, I've read these questions/answers:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/9817860/ef-migration-message">EF-migration message</a></li>
  <li><a href="https://stackoverflow.com/questions/11204900/how-can-i-stop-add-migration-checking-my-database-has-no-pending-migrations-when">How can I stop Add-Migration checking my database has no pending migrations when using Code-Based migrations?</a></li>
  <li><a href="https://stackoverflow.com/questions/9924946/make-ef4-3-code-first-migrations-ignore-pending-migrations">Make EF4.3 Code First Migrations ignore pending migrations</a></li>
  </ul>
  
  <p>These all seem to be for EF versions prior to EF5, and my situation doesn't seem to fit these answers. So, let me describe my situation.</p>
  
  <ol>
  <li>My application was originally created using EF4, model first. I designed my database with the GUI designer, and used it to generate my database.</li>
  <li>I've been running and collecting data into the database for a few months. I really can't lose this data.</li>
  <li>I branched my code, installed EF5 with NuGet, and used EF Power Tools to generate my model from my database by right-clicking a new class library project, and selecting <code>Entity Framework | Reverse engineer code first</code>.</li>
  <li>I was able to smoothly re-reference to my new project, convert my project to use the new DbContext instead of ObjectContext, and removed the EF4 class library that held my old model. The program works great!</li>
  </ol>
  
  <p>Now, I want to try out automatic migrations, which I've had a tiny bit of experience with in Ruby on Rails. Here's what I did:</p>
  
  <ol>
  <li>Ran <code>Enable-Migrations</code>. Had a bit of trouble due to connection strings and which app.config was getting used, but eventually got it. However, <a href="http://msdn.microsoft.com/en-us/data/jj193542" rel="nofollow noreferrer">this MSDN page</a> says that this should have automatically generated the first migration to get me to the point I'm already at. It didn't.</li>
  <li>Ran <code>Add-Migration InitialSchema</code> to accomplish what wasn't automatically done in step 1. This worked.</li>
  <li>Added a property to one of my model objects, then attempted to run <code>Add-Migration AddSerialToLogEntries</code>, and was presented with:</li>
  </ol>
  
  <blockquote>
    <p>Unable to generate an explicit migration because the following
    explicit migrations are pending: [201307190100268_InitialSchema].
    Apply the pending explicit migrations before attempting to generate a
    new explicit migration.</p>
  </blockquote>
  
  <p>Attempting to apply the migration on my existing database failed, which isn't surprising.</p>
  
  <p>The other answers I mentioned above basically said that I'm out of luck, but like I said those were for older versions of the Entity Framework. Do I have any options here?</p>
  
  <p>While writing this question, I thought I might be able to use SQL Server Management Studio to export my data to a SQL script, delete the entire database, let EF create it, then run the scripts to get my data back in... I will try that tomorrow when I have time, but I would like to hear if there are other options as I'm not 100% sure that would work and would hate to have any errors in the data inserted in the process.</p>