/** * update schema of modelconfig enabled app * * @param string $appName * @param array $modelNames * @throws Setup_Exception_NotFound */ public function updateSchema($appName, $modelNames) { $updateRequired = false; $setNewVersions = array(); foreach ($modelNames as $modelName) { $modelConfig = $modelName::getConfiguration(); $tableName = Tinebase_Helper::array_value('name', $modelConfig->getTable()); $currentVersion = $this->getTableVersion($tableName); $schemaVersion = $modelConfig->getVersion(); if ($currentVersion < $schemaVersion) { $updateRequired = true; $setNewVersions[$tableName] = $schemaVersion; } } if ($updateRequired) { Setup_SchemaTool::updateSchema($appName, $modelNames); foreach ($setNewVersions as $table => $version) { $this->setTableVersion($table, $version); } } }