Dealing with Conflicts in EF Core Migration

Entity Framework Core provides a lot of functionalities right out of the box, but it is not without its demerits. One of the issues that faced recently is that DbContextModelSnapshot.cs snapshot file gets when a group of developers try to merge their work upstream and it just gets all messy

I would suggest the below flow to deal with conflicts in EF Core Migration that works for my case:

1. Pull from upstream

2. If conflict exists on *DbContextModelSnapshot.cs file, abort merge

3. Revert your migration by removing it using (Remove-Migration from the console)

4. Pull from upstream

5. Resolve conflicts (from other files if any)

6. Add migration again

This flow works for us but it will be an issue with larger teams. Drop us a comment if you have other suggestions