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:
parent
d98b62cc69
commit
a2131f6ee7
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||||
|
|
Loading…
Reference in a new issue