In schema_upgrades branch I implemented a new method of upgrading database schema. Since now we'll store sql upgrade commands in separate file for each upgrade point. You can see the structure in SQL directory.
We also add a new table 'system' where we store current schema version. There we have columns 'name' and 'value'. Where value is schema version number and name is a string with suffix "-version". For Roundcube core schema the key will be "roundcube-version". For plugins I propose to use <plugin_name>-plugin-version.
There's also a new script bin/updatedb.sh which is used automatically by update.sh script and installer. The updatedb.sh script can be used also by hand e.g. to run plugins' schema updates. Sample usage:
updatedb.sh --dir=../plugins/someplugin/SQL --version=0.9-beta
--label=someplugin-plugin
Argument --version is optional when upgrading from 0.9-beta or later version. Directory specified in --dir must have the same structure as core SQL directory.
Schema version number is in format YYYYMMDDXX.sql. Where XX is a number of change in the same day, starting from 00. It is used only for sorting to execute changes in proper order.
We'll apply this change before 0.9-rc. Any opinions?