public function getSqlQueriesToExecute()
{
$queries = array();
$classNames = array();
foreach ($this->componentsWithUpdateFile as $componentName => $componentUpdateInfo) {
foreach ($componentUpdateInfo as $file => $fileVersion) {
require_once $file;
// prefixed by PIWIK_INCLUDE_PATH
$className = $this->getUpdateClassName($componentName, $fileVersion);
if (!class_exists($className, false)) {
throw new \Exception("The class {$className} was not found in {$file}");
}
if (in_array($className, $classNames)) {
continue;
// prevent from getting updates from Piwik\Columns\Updater multiple times
}
$classNames[] = $className;
/** @var Updates $update */
$update = StaticContainer::getContainer()->make($className);
$migrationsForComponent = $update->getMigrations($this);
foreach ($migrationsForComponent as $index => $migration) {
$migration = $this->keepBcForOldMigrationQueryFormat($index, $migration);
if ($migration instanceof Migration\Db) {
$queries[] = $migration;
}
}
$this->hasMajorDbUpdate = $this->hasMajorDbUpdate || call_user_func(array($className, 'isMajorUpdate'));
}
}
return $queries;
}