I'm a part of a large java project with multiple modules (30 or so jars) and am interested in the use of flyway to manage database migrations.
As a part of company policy, migration scripts related to each project live in each module and at migration time are aggregated to form one large sql script from release --> release. (e.g. build 234 --> 298). also worthy of noting is that we currently use CVS (obligatory -_- face) and are looking at git as a replacement :).
due to Git's distributed nature, It is counter-intuitive to think of sequential version numbers for naming flyway migration scripts. let me digress further...
Scenario
- A user branches off master
Aonto his feature branchB - A seperate user branches of
Ato their own featureC - Someone commits a script to
B. Lets call itscript 1 - Someone else commits a script to
C.script 2 - At some point these changes are brought into the master branch
And now if you can't already see the problem, the order in which these changes are brought into master is arbitrary. the developers cannot version their scripts appropriately (assuming that no communication is done in regards to commit order amongst the team). script 2 could be brought in at some point, migrated, then later script 1 is brought in and placed before script 2' file in terms of flyway script versions.
Question
How does Flyway manage "inserted" scripts when the database has already migrated past them?
This is one of my only concerns in moving the current system into using flyway and any insight/help would be appreciated.