Jarvis
Member
If I want the upgrade of an addon to not run anything on the database, can I manage that with the install callback?
Currently I have:
Is there anything such as a boolean for if the user is upgrading or installing an addon? As I'd like to have the upgrade not affect data already entered into the tables as currently any upgrade wipes table data.
Currently I have:
PHP:
// This is the function to create a table in the database so our addon will work.
public static function install($addon)
{
if ($addon['version_id'] < 575) {
$db = XenForo_Application::getDb();
// add tables from first release
} else if ($addon['version_id'] == 575) {
$db = XenForo_Application::getDb();
// add new table included in version 575
} else {
$db = XenForo_Application::getDb();
// create tables
}
}
Is there anything such as a boolean for if the user is upgrading or installing an addon? As I'd like to have the upgrade not affect data already entered into the tables as currently any upgrade wipes table data.