This feature could be implemented as in phpMyVisites (it works well)
It makes it easy and secure to update from one version to another.
The software checks that the version in the database is the same as the version in the version.php.
If the version.php has a newer version, we update the database with all the changes that were done between both versions.
We can also execute some random php code as every version provides a file containing the changes to apply. This way of doing things is easy and very modular (you can do what you want during the update).
Display version number
Task also include display the version number somewhere in the admin UI, in the META tags on all piwik generated pages, an in the error/exception messages.
To do by default in first piwik release that has update feature
when updating from previous to first version with update system we need to:
Some web hosting services forget to give permission for ADD INDEX for the mysql users of their customers. Piwik creates the INDEX in a separate query at the moment, but this is not necessary. We could create the index in the CREATE TABLE statements.
In case we have to create the index afterwards (during the update process), we should catch this error and display a friendly error message (Please ask your web host to give you CREATE INDEX permission// or here is how to do it yourself)
still to do: show version number in UI. closing