* code for task#1779.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user