Module: appdb Branch: master Commit: c2d2c7ad817828cafcf6e967b451fbdf009f268d URL: http://source.winehq.org/git/appdb.git/?a=commit;h=c2d2c7ad817828cafcf6e967b...
Author: Rosanne DiMesio dimesio@earthlink.net Date: Fri Aug 25 10:24:23 2017 -0500
Fix submitTime field
Fixes a regression created by 4a1506322966340d3ad42151ffa31f551e7e9f4c where the submitTime field was not being filled in on new test reports.
Signed-off-by: Rosanne DiMesio dimesio@earthlink.net Signed-off-by: Jeremy Newman jnewman@codeweavers.com
---
include/testData.php | 7 +++---- tables/alter.sql | 4 ++++ tables/testResults.sql | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/include/testData.php b/include/testData.php index 49cfa69..98f1c09 100644 --- a/include/testData.php +++ b/include/testData.php @@ -84,11 +84,11 @@ class testData{ "testedRelease, staging, installs, runs,". "usedWorkaround, workarounds,". "testedRating, comments,". - "submitTime, submitterId, state,". + "submitterId, state,". "gpuMfr, graphicsDriver)". "VALUES('?', '?', '?', '?', '?', '?', '?',". "'?', '?', '?', '?', '?',". - "'?', '?', '?', '?', '?', '?', '?')", + "'?', '?', '?', '?', '?', '?')", $this->iVersionId, $this->shWhatWorks, $this->shWhatDoesnt, @@ -102,8 +102,7 @@ class testData{ $this->sUsedWorkaround, $this->shWorkarounds, $this->sTestedRating, - $this->sComments, - "NOW()", + $this->sComments, $_SESSION['current']->iUserId, $this->sState, $this->sGpuMfr, diff --git a/tables/alter.sql b/tables/alter.sql index 457f8d9..8aa4423 100644 --- a/tables/alter.sql +++ b/tables/alter.sql @@ -1,2 +1,6 @@ /* append to this file when changes are required to the live db */ /* it will be cleared when the changes go live */ +ALTER TABLE `testResults` CHANGE `submitTime` `submitTime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; + +/* to fix the incorrect entries*/ +UPDATE testResults SET submitTime = testedDate WHERE submitTime = '0000-00-00 00:00:00' diff --git a/tables/testResults.sql b/tables/testResults.sql index 511c115..be80b9d 100644 --- a/tables/testResults.sql +++ b/tables/testResults.sql @@ -21,7 +21,7 @@ create table testResults ( workarounds text default NULL, testedRating enum('Platinum','Gold','Silver','Bronze','Garbage') NOT NULL, comments text, - submitTime datetime NOT NULL, + submitTime datetime NOT NULL default CURRENT_TIMESTAMP, submitterId int(11) NOT NULL default '0', state enum('accepted','queued','rejected','pending','deleted') NOT NULL default 'accepted', gpuMfr enum('AMD', 'Intel', 'Nvidia', 'Other', 'Unknown') default NULL,