[AppDB] Fix submitTime field
Rosanne DiMesio
dimesio at earthlink.net
Fri Aug 25 10:24:23 CDT 2017
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 at earthlink.net>
---
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,
--
2.12.3
More information about the wine-patches
mailing list