I found by Joomla 3.x, that I can use an install script something like this:
class Com_ExampleInstallerScript
{
public function install($adapter)
{
// create tables
}
public function uninstall($adapter)
{
// remove tables
}
public function update($adapter)
{
// alter tables
}
public function preflight($route, $adapter)
{
// stop service, probably creating a lock file
}
public function postflight($route, $adapter)
{
// start service, probably removing a lock file
}
}
Everything is fine except the update part. I guess this runs when I already have installed an older version and try to install the new version. If so, then how can I get the version number of the old version? I don't want to use upgrade SQL files, so that's not the answer.