Is a "model" branch a common practice?

Posted by dukeofgaming on Programmers See other posts from Programmers or by dukeofgaming
Published on 2012-10-10T05:28:36Z Indexed on 2012/10/10 9:51 UTC
Read the original article Hit count: 249

Filed under:
|
|

I just thought it could be a good thing to have a dedicated version control branch for all database schema changes and I wanted to know if anyone else is doing the same and what have the results been.

Say that you are working with:

  1. Schema model/documentation (some file where you model the database visually to generate the schema source, say MySQL Workbench, with a .mwb file, which is binary)
  2. Schema source (a .sql file)
  3. Schema-based code generation

The normal way we were working was with feature branches, so we would do changes to the model files (the database specific ones), and then have to regenerate points 2 and 3, dealing with the possible conflicts (or even code rewriting).

Now say that your workflow goes the same way as the previous item numbering. With a model branch you wouldn't have to reconcile the schema model with binaries in other feature branches, or have to regenerate schema source and regenerate code (which might have human code on top of it).

It makes so much sense to me it feels weird not having seen this earlier as a common practice.

Edit: I'm counting on branch merges to be the assertions for the model matching the code. I use a DVCS, so I don't fear long-lived branches or scary-looking merges. I'm also doing feature branching.

© Programmers or respective owner

Related posts about dvcs

Related posts about cvcs