Am I safe to merge Entity Framework Core migrations added by "feature branches"?

16 hours ago 1
ARTICLE AD BOX

I have a workflow I use with our development team that involves merging EF Core migrations in our C# project. Our team works in feature branches and often needs to create new EF Core migrations. They raise a new pull request when they're done and I go to perform code review.

Currently, if the PR contains a migration I remove it prior to merging the PR. Then, I swap over to master branch and recreate the PR. I do this to ensure it falls in proper chronological order. The feature branch most likely it not up to date with master and so the migration probably doesn't fall in chrono order correctly.

This workflow causes issues with the developers' local dev environment, though. Now the dev who made the migration has a situation where their local database references a migration that no longer exists.

Is it safe to just merge the PRs that exists in the feature branch? I've never been sure.

Read Entire Article