Fixed plugins database upgrade.
This commit is contained in:
@@ -706,7 +706,10 @@ class System {
|
|||||||
* @return $sContent
|
* @return $sContent
|
||||||
*/
|
*/
|
||||||
public static function getPluginSchema($pluginName) {
|
public static function getPluginSchema($pluginName) {
|
||||||
|
if (file_exists(PATH_PLUGINS . $pluginName . "/config/schema.xml"))
|
||||||
return System::getSchema(PATH_PLUGINS . $pluginName . "/config/schema.xml");
|
return System::getSchema(PATH_PLUGINS . $pluginName . "/config/schema.xml");
|
||||||
|
else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ class workspaceTools {
|
|||||||
public function upgradePluginsDatabase() {
|
public function upgradePluginsDatabase() {
|
||||||
foreach (System::getPlugins() as $pluginName) {
|
foreach (System::getPlugins() as $pluginName) {
|
||||||
$pluginSchema = System::getPluginSchema($pluginName);
|
$pluginSchema = System::getPluginSchema($pluginName);
|
||||||
|
if ($pluginSchema !== false)
|
||||||
$this->upgradeSchema($pluginSchema);
|
$this->upgradeSchema($pluginSchema);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -320,9 +321,8 @@ class workspaceTools {
|
|||||||
throw new Exception("Only MySQL is supported");
|
throw new Exception("Only MySQL is supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
$currentSchema = System::getSchema();
|
|
||||||
$workspaceSchema = $this->getSchema();
|
$workspaceSchema = $this->getSchema();
|
||||||
$changes = System::compareSchema($workspaceSchema, $currentSchema);
|
$changes = System::compareSchema($workspaceSchema, $schema);
|
||||||
$changed = (count($changes['tablesToAdd']) > 0 ||
|
$changed = (count($changes['tablesToAdd']) > 0 ||
|
||||||
count($changes['tablesToAlter']) > 0 ||
|
count($changes['tablesToAlter']) > 0 ||
|
||||||
count($changes['tablesWithNewIndex']) > 0 ||
|
count($changes['tablesWithNewIndex']) > 0 ||
|
||||||
|
|||||||
Reference in New Issue
Block a user