Fixed plugins database upgrade.

This commit is contained in:
Alexandre Rosenfeld
2010-12-17 14:55:05 +00:00
parent a0a53ef23b
commit 5a3de34d3f
2 changed files with 7 additions and 4 deletions

View File

@@ -706,7 +706,10 @@ class System {
* @return $sContent
*/
public static function getPluginSchema($pluginName) {
if (file_exists(PATH_PLUGINS . $pluginName . "/config/schema.xml"))
return System::getSchema(PATH_PLUGINS . $pluginName . "/config/schema.xml");
else
return false;
}
/**

View File

@@ -304,6 +304,7 @@ class workspaceTools {
public function upgradePluginsDatabase() {
foreach (System::getPlugins() as $pluginName) {
$pluginSchema = System::getPluginSchema($pluginName);
if ($pluginSchema !== false)
$this->upgradeSchema($pluginSchema);
}
}
@@ -320,9 +321,8 @@ class workspaceTools {
throw new Exception("Only MySQL is supported");
}
$currentSchema = System::getSchema();
$workspaceSchema = $this->getSchema();
$changes = System::compareSchema($workspaceSchema, $currentSchema);
$changes = System::compareSchema($workspaceSchema, $schema);
$changed = (count($changes['tablesToAdd']) > 0 ||
count($changes['tablesToAlter']) > 0 ||
count($changes['tablesWithNewIndex']) > 0 ||