mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-30 21:10:29 +03:00
Update database schema
Add into the plugins table a column to store last known initialization status
This commit is contained in:
parent
3f97ad09df
commit
57afba72e8
@ -314,6 +314,8 @@ plugin:
|
||||
installed: "tinyint NOT NULL DEFAULT 0"
|
||||
# Indicates if the plugin is enabled or not.
|
||||
enabled: "tinyint NOT NULL DEFAULT 0"
|
||||
# Indicates if the plugin is initialized or not.
|
||||
initialized: "tinyint NOT NULL DEFAULT 0"
|
||||
unique_keys:
|
||||
name: [name]
|
||||
|
||||
|
@ -412,4 +412,30 @@ class Updater
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs all database updates needed for 2.2.0.
|
||||
*
|
||||
* @return boolean True if the updates have been applied successfully and
|
||||
* false otherwise.
|
||||
*/
|
||||
protected function update20200()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// Alter locale table.
|
||||
$db->query('ALTER TABLE {plugin} ADD COLUMN initialized tinyint NOT NULL DEFAULT 0 AFTER enabled');
|
||||
} catch (\Exception $e) {
|
||||
$this->errors[] = getlocal('Cannot update tables: {0}', $e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user