From 9ccedb085cefb4b8c6de823c0086b28d2e3e4d78 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 2 Dec 2010 06:14:49 +0000 Subject: [PATCH] * fix the error when upgradeing. --- db/update1.3.sql | 3 --- module/upgrade/model.php | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/update1.3.sql b/db/update1.3.sql index 0b94d9d316..8234771c40 100644 --- a/db/update1.3.sql +++ b/db/update1.3.sql @@ -38,8 +38,5 @@ ALTER TABLE `zt_task` ADD `closedReason` VARCHAR( 30 ) NOT NULL AFTER `closedDat update zt_groupPriv set method='finish' where module='task' and method='complete'; -UPDATE zt_task SET assignedTo = openedBy,assignedDate = finishedDate WHERE STATUS = 'done'; -UPDATE zt_task SET assignedTo = openedBy,assignedDate = canceledDate WHERE STATUS = 'cancel'; - -- test task table. ALTER TABLE `zt_testTask` ADD `owner` VARCHAR( 30 ) NOT NULL AFTER `build` ; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index a0a3589a14..8bf98d813a 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -388,9 +388,9 @@ class upgradeModel extends model */ private function upgradeFrom1_3To1_4() { + $this->execSQL($this->getUpgradeFile('1.3')); $this->updateNL1_3(); $this->updateTasks(); - $this->execSQL($this->getUpgradeFile('1.3')); if(!$this->isError()) $this->setting->updateVersion('1.4'); } @@ -519,7 +519,7 @@ class upgradeModel extends model { $project->desc = nl2br($project->desc); $project->goal = nl2br($project->goal); - $this->dao->update(TABLE_RPOJECT)->data($project)->where('id')->eq($project->id)->exec(); + $this->dao->update(TABLE_PROJECT)->data($project)->where('id')->eq($project->id)->exec(); } foreach($builds as $build) @@ -606,6 +606,9 @@ class upgradeModel extends model $this->dao->update(TABLE_TASK)->data($task, false)->where('id')->eq($task->id)->exec(false); } + $this->dao->update(TABLE_TASK)->set('assignedTo=openedBy, assignedDate = finishedDate')->where('status')->eq('done')->exec(false); + $this->dao->update(TABLE_TASK)->set('assignedTo=openedBy, assignedDate = canceledDate')->where('status')->eq('cancel')->exec(false); + /* Update action name. */ }