http://www.wowroster.net/MediaWiki/AddonSDK#AddOn_Install_Class_Methods
upgrade($oldversion)
Here you can add all queries for an upgrade.
$oldversion, the version you are upgrading from.
Return true on success, false on failure.
Using version_compare() you can write blocks to upgrade from certain versions with the oldest upgrade first, then the next blocks can catch older versions and upgrade them incrementally
- Code: Select all
if( version_compare('2.0.6.2', $oldversion,'>') == true )
{
}
if( version_compare('2.0.6.4', $oldversion,'>') == true )
{
}
if( version_compare('3.0.0.0', $oldversion,'>') == true )
{
}
So with this we can upgrade versions 2.0.0.0 all the way up to 3.0.0.0
Also, do not worry about trying to upgrade your version number in the upgrade block, change your installer class variables to update ti
$version, $icon, $fullname, $description, $credits will all be updated to whatever you have them during the upgrade