Modify setup such as to install a column for the device ID. VARCHAR(36) such as to take a UUID.

This commit is contained in:
Klaus-Uwe Mitterer 2016-08-03 19:40:04 +02:00
parent d98b62cc69
commit a2131f6ee7

View file

@ -8,7 +8,7 @@ if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error); die("Connection failed: " . $conn->connect_error);
} }
$sql = "CREATE TABLE tracker ( ts TIMESTAMP PRIMARY KEY DEFAULT CURRENT_TIMESTAMP, lat DOUBLE, lon DOUBLE );"; $sql = "CREATE TABLE tracker ( ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, device VARCHAR(38), lat DOUBLE, lon DOUBLE, PRIMARY KEY(ts, device) );";
if (!mysqli_query($conn, $sql)) { if (!mysqli_query($conn, $sql)) {
die('Error: ' . mysqli_error($conn)); die('Error: ' . mysqli_error($conn));