0

I have an project using EF Code First and migrations. I recently changed the assembly and project names and the namespaces to a new name and continued working on it.

I tried to add a new migration and now it is complaining that I need to complete all the previous migrations before doing so ("Unable to generate an explicit migration because the following explicit migrations are pending"). I looked at the records and they have a ContextKey that has the old assembly name but that doesn't seem to resolve the issue.

Is there a way to make it recognize that the old migrations in the migration history are the same ones that are currently in the assembly?

Casey
  • 3,307
  • 1
  • 26
  • 41
  • Do you really need to keep trace of your old migrations ? If no, you can restart from 0, removing all in your migration code / migration history tables, and re-Enable migrations... – Raphaël Althaus Jun 05 '14 at 16:33
  • @RaphaëlAlthaus Yes, because the old version of this application is in production (otherwise I wouldn't have migrations on in the first place). I guess I could try and work around that although it sounds like a nightmare. – Casey Jun 05 '14 at 16:35
  • Does this help ? [Fixing CF Migrations](http://stackoverflow.com/questions/10254613/mvc3-and-code-first-migrations/10255051#10255051) - the (3) should work in the worst case. I'm not anywhere near VS, but it can be worked around I'm sure, changing records didn't do anything? – NSGaga-mostly-inactive Jun 05 '14 at 17:27

0 Answers0