mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 05:20:30 +03:00
Prepare database update for the next release
This commit is contained in:
parent
e9b29737c9
commit
a9644ddec1
@ -465,4 +465,32 @@ class Updater
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs all database updates needed for 3.2.0.
|
||||
*
|
||||
* @return boolean True if the updates have been applied successfully and
|
||||
* false otherwise.
|
||||
*/
|
||||
protected function update30200()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// Alter requestcallback table: replace column with an invalid name.
|
||||
$db->query('ALTER TABLE {requestcallback} ADD COLUMN `func` VARCHAR(64) NOT NULL AFTER `function`');
|
||||
$db->query('UPDATE {requestcallback} SET `func` = `function`');
|
||||
$db->query('ALTER TABLE {requestcallback} DROP COLUMN `function`');
|
||||
} catch (\Exception $e) {
|
||||
$this->errors[] = getlocal('Cannot update tables: {0}', $e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user