Like practically any application, applications that I deal with evolve. They change their requirements when it comes to database storage – new tables, new columns, modified columns. Or perhaps – new base data – like new values in virtually static dictionaries.
For past years we've been working with set of pl/plgsql functions which kept track of “patches", and their dependencies.
The problem with this approach is that it doesn't really scale well, and it generates problems when we use replication (Slony).
The problems mean that we have to apply the patches “by hand" on master/slave server, because downtime in the day is not acceptable, and nobody is willing to do upgrades at 3 am just to be able to add new column.
So, we deal with it. But lately I grew annoyed by this, and started to think about a better way to organize patches.
I “dream" about a system when I would write a patch itself, and the system will make it possible to install and uninstall it with automatic changing database to prior state (this is not simple with things like “update", but it is definitely possible).
System which would “understand" replication, and apply changes to all replicated servers in a way that it will be as safe as possible with no or minimal downtime.
System which would let me track dependencies, and then install them if I'll tell it to install patch, that requires some other patches that were not applied to target database.
Basically – I want something like apt-get/dpkg/rpm for database.
So, writing this seems to be perfectly possible, but is it necessary? Perhaps somebody someplace already wrote such system? Do you know any? Or should I stop whining, sit down and write it myself?