Add docker container definition
Change-Id: If32020e6b8e8bb816eb54533554b18cc5302b5c9
diff --git a/admin/createtable.php b/admin/createtable.php
index 07ad979..9db621e 100644
--- a/admin/createtable.php
+++ b/admin/createtable.php
@@ -3,7 +3,7 @@
require '../php/utils.php';
$credentials = new Credentials();
- if ($credentials->adminToken != ($_GET["token"] ?? "")) {
+ if ($credentials->adminToken() != ($_GET["token"] ?? "")) {
exit();
}
@@ -28,6 +28,14 @@
`curs` tinyint(1) NOT NULL,
`grau` tinyint(1) NOT NULL,
`data` timestamp NOT NULL DEFAULT current_timestamp()
+ )",
+ "CREATE TABLE IF NOT EXISTS `missatges` (
+ `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ `sender_id` int(11) NOT NULL,
+ `receiver_id` int(11) NOT NULL,
+ `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
+ `content` text NOT NULL,
+ `seen` tinyint(1) DEFAULT 0
)"];
foreach ($queries as $query) if (!query($query)) die('An error ocurred. ' . $query);