Database change management - how to handle changes on branch and trunk
===

Tools such as liquibase and flyway certainly make it easy to upgrade your database.  What I haven't gotten straight in my mind is how to best handle changes that occur both on a release branch and trunk.

An example:

My code that is in product is version 2.5 and lives on a release branch.   In the meantime, developers have started working on version 3.0 which lives on trunk.

A bug is found in production.   A database change script is made (2.5.1) and committed to the release branch.    The same change script must be merged back to trunk (3.0.1?).

Version 3.x is released into the wild production db's will already have the change from 2.5.1.  The upgrade could potentially fail.

Conversely, if I'm creating a db from scratch if i was using a forward only strategy I would have the same change occurring twice (2.5.1 and 3.0.1).

How are others handling this scenario?

