public function updateToLatest($module)
{
if (($newMigrations = $this->getNewMigrations($module)) !== []) {
if (Yii::app()->hasComponent('cache')) {
Yii::app()->getComponent('cache')->flush();
}
Yii::log(Yii::t('YupeModule.yupe', 'Updating DB of {module} to latest version', ['{module}' => $module]));
foreach ($newMigrations as $migration) {
if ($this->migrateUp($module, $migration) === false) {
return false;
}
}
if (Yii::app()->hasComponent('cache')) {
Yii::app()->getComponent('cache')->flush();
}
} else {
Yii::log(Yii::t('YupeModule.yupe', 'There is no new migrations for {module}', ['{module}' => $module]));
}
return true;
}