Does anyone know a good way to allow larger projects, with lots of engineers working in parallel, to handle versioning with Flyway? We often find that during merges to master, we wind up with conflicting merges just because 2-3 independent projects needed db changes, and they used the same version number.
In this scenario, I'm not even sure if a Rails-style timestamp for versioning would work, because you don't necessarily know the order in which the merges will be made to master.
Any good tricks to get around this, aside from having to re-number your migration just before merge?
Tom
While both tools are based on Martin Fowler's Evolutionary Database, there are many differences in what these tools offer. Here's where Liquibase and Flyway differ. The bottom line is that Liquibase is more powerful and flexible — covering more database change and deployment use cases than Flyway.
Flyway applies SQL migration scripts within a transaction, whenever possible, and will roll back the whole migration if it receives an error message on its connection to the database.
In Flyway, a baseline is simply an entry in the history table, with a version that tells Flyway the point from which to start all subsequent migrations. The baselining process doesn't create any scripts or other files in the Scripts directory.
Flyway doesn't lock the schema. It then acquires a lock on the metadata table using SELECT * FROM metadatatable FOR UPDATE . This lock is released automatically after the migration completes when the transaction is commited or rolled back.
Renumbering certainly is one way.
Another simple technique for avoiding version number conflicts, is to have a whiteboard or a simply wiki page, where each developer can reserve a version number when they start working on it.
Alternatively, Flyway 1.8 will be out soon and it will include a feature that optionally allows migrations to be run out of order. This is however not risk-free in all scenarios.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With