mirror of
https://github.com/Mibew/mibew.git
synced 2025-04-12 02:30:10 +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"
|
installed: "tinyint NOT NULL DEFAULT 0"
|
||||||
# Indicates if the plugin is enabled or not.
|
# Indicates if the plugin is enabled or not.
|
||||||
enabled: "tinyint NOT NULL DEFAULT 0"
|
enabled: "tinyint NOT NULL DEFAULT 0"
|
||||||
|
# Indicates if the plugin is initialized or not.
|
||||||
|
initialized: "tinyint NOT NULL DEFAULT 0"
|
||||||
unique_keys:
|
unique_keys:
|
||||||
name: [name]
|
name: [name]
|
||||||
|
|
||||||
|
@ -412,4 +412,30 @@ class Updater
|
|||||||
|
|
||||||
return true;
|
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