As I write the code is on git repository. I have a question about flow/good practises to maintain project contributed by many developers.
When migration should be generated?
I think about two cases.
Case 1)
Developer A commit changes and merge with master. No migration generated.
Developer B commit changes and merge with master (resolving conflicts if is). No migration generated.
Developer A genereate migration and push to master. (1.0.1)
Developer B pull from master, run migration. (1.0.1)
Developer B generate migration push to master. (1.0.2)
Developer A pull from master, run migration. (1.0.2)
But - this flow probably doesn't work as I expect because when developer B run migration (1.0.1) his changes on database was lost. Am I right?
Case 2)
Developer A commit changes, generate migration and merge with master (1.0.1).
Developer B commit changes. And what next? Should he generate migration? (possibilites in subcase below)
Subcase 2.1)
Developer B generate migration (also 1.0.1). When he want to merge with master there is conflict with migrations/1.0.1 directory. He can use a diff tool to see which fields what added/chnaged and edit the db scheme. Next he accepts version from master. Next generate migration again (now it is 1.0.2 and contains his changes and changes made by developer A) and merge with master again.
Subcase 2.2)
Developer B no generate migration. And what next he should do?
What do you think about that?