Team Environment Entity Framework Code First - Is it appropriate to just delete _MigrationHistory table to resync your model project to the database?

StackOverflow https://stackoverflow.com/questions/22466870

Question

My team is continually having issues with EF CF migrations.

Very similar to the issues that are all over the web in relation to team EF CF migrations.

Basically, our migrations get out of sync because we have so many developers making changes and some aren't using codefirst, or some have migrations pending, or any other number of issues that can make this table go out of sync.

In the past we have just deleted the contents of the _MigrationHistory table to wipe out errors that we are receiving, then created and run our new migrations.

I haven't ever seen this listed as a solution to the team EF CF Migration issue, so I am wondering is this a completely haphazard solution to solving this issue?

Is there a way to resync your migration table to the existing database so that there aren't so many issues?

My team is fairly new to Entity Framework and CF, initially it was working fantastic but as more developers have started to get into the slns, it seems the more issues we have had. There are several of us that have perused the contents of the interwebs looking for a solution but haven't found a very concise way of doing this.

Oh, and I have seen this article. :

http://msdn.microsoft.com/en-us/data/dn481501

Was it helpful?

Solution

@Bill_Blankenship, you said:

we have so many developers making changes and some aren't using codefirst

Well therein lies your issue. Get all your developers on the same page and the suggestions in http://msdn.microsoft.com/en-us/data/dn481501 will lead to more success for your team.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top