Commit 8350f845 authored by GROSS-AMBLARD David's avatar GROSS-AMBLARD David
Browse files

Adding automatic timestamps in Answer and Answered tables

parent 5bdb3b75
...@@ -213,7 +213,7 @@ function insertAnswer($conn, $id, $artifactid, $value, $mass, $isAjax=false, $he ...@@ -213,7 +213,7 @@ function insertAnswer($conn, $id, $artifactid, $value, $mass, $isAjax=false, $he
$stmt->execute() or die(mysql_error()); $stmt->execute() or die(mysql_error());
// indicated that the task has been answered // indicated that the task has been answered
$conn->query("insert into Answered values ($id,$artifact)") or die(); $conn->query("insert into Answered(id,artifact) values ($id,$artifact)") or die();
update($conn, $artifact); update($conn, $artifact);
......
<?php
/**
* Configuration file
*
*/
// Set DEBUG to true to see plenty of error messages
define("DEBUG",false);
// define("DEBUG",true);
// Location of the log file
define("LOGFILENAME","log/log.txt");
// Add more error messages from PHP
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);
// Mysql parameters
define("SERVERNAME","localhost");
define("USERNAME","headworkadmin");
define("PASSWORD","<your password here>");
define("DATABASE","headwork");
// Wirk connector parameters
define("WIRKAPIUSER","<your Wirk endpoint>");
define("WIRKAPIPASSWORD,"<your Wirk password");
define("WIRKAPPID","853");
define("WIRKQUALITYID","1386");
define("WIRKPROJECTENDPOINT","https://api.wirk.io/v1_0/AppProject");
define("WIRKTASKLINEENDPOINT","https://api.wirk.io/v1_0/TaskLine");
?>
...@@ -52,7 +52,8 @@ CREATE TABLE IF NOT EXISTS Answer ( ...@@ -52,7 +52,8 @@ CREATE TABLE IF NOT EXISTS Answer (
value mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, value mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
mass float default 1, mass float default 1,
help json DEFAULT NULL, help json DEFAULT NULL,
step int(11) DEFAULT NULL step int(11) DEFAULT NULL,
modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
-- TODO missing FK -- TODO missing FK
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
...@@ -501,7 +502,8 @@ CREATE TABLE BroadcastArtifactClass( ...@@ -501,7 +502,8 @@ CREATE TABLE BroadcastArtifactClass(
CREATE TABLE Answered ( CREATE TABLE Answered (
id int NOT NULL, id int NOT NULL,
artifact int NOT NULL artifact int NOT NULL,
modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
); );
CREATE TABLE ServiceCall ( CREATE TABLE ServiceCall (
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment