In my project we have a branch model that has a separate development branch and has a separate branch for each release. It may look like this:
dev ______ ______ / \ / \ master --+---+----+---+---+----+----+--- (...) r1 \______/ r2 \_______/
So we develop on dev merge it to master and then we create a release branch (r1, r2, ...).
We want to use EF 6 (manual not automatic) migrations but we have a question that we don't know how to answer.
dev _(1)__ ____(4) / \ / \ master --+---+----+---+---+----+-(5)*-+--- (...) r1 \_(2)__/ r2 \(3)______/
Each number is a migration. They have been added to the source control on each branch AND have been applied to the databases of production instances of our project (we support multiple releases for some time just for fixes) so we cannot downgrade them, they can go only Up(). Asterisk marks the point in time we want to analyze. We want migrations to work this way:
Can that be done? If yes, how?
If you need more details, please ask.
I could try to explain what you can do in each case, but it's quite complex and I would not be able to explain it as well as it's explained here:
Although it's complex and you'll have to refer to this document frequently to merge the branches, if you follow this document you'll see that it solves all your questions.
Disclaimer: I know SO should be self contained, but the explanation is so complex and long that I can't even add an abstract here. I hope that the linked MSDN docs don't dissapear.