* code for task#1779.

This commit is contained in:
xia0ta0
2014-02-27 16:13:30 +08:00
parent 166e9a255e
commit 2fa7e4a257
6 changed files with 23 additions and 10 deletions
+22
View File
@@ -98,6 +98,9 @@ class upgradeModel extends model
case '5_0':
case '5_1':
case '5_2':
case '5_2_1':
$this->mergeProjectGoalAndDesc();
$this->execSQL($this->getUpgradeFile('5.2.1'));
default: if(!$this->isError()) $this->setting->updateVersion($this->config->version);
}
@@ -754,6 +757,25 @@ class upgradeModel extends model
return true;
}
/**
* Merge the goal and desc of project.
*
* @access public
* @return void
*/
public function mergeProjectGoalAndDesc()
{
$projects = $this->dao->select('id, goal, `desc`')->from(TABLE_PROJECT)->fetchAll('id');
foreach($projects as $id => $project)
{
$this->dao->update(TABLE_PROJECT)
->set('`desc`')->eq($project->goal . '<br />' . $project->desc)
->where('id')->eq($id)
->exec();
}
return true;
}
/**
* Judge any error occers.
*