summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/install.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2024-12-16 16:06:38 +0100
committerSimon Rettberg2024-12-16 16:06:38 +0100
commit8e706622c388c16d25c21048c35b3a08a9096449 (patch)
tree57377ea887bd1937bc7d4ed888b3d7713cd6237e /modules-available/statistics/install.inc.php
parentUpdate translations (diff)
downloadslx-admin-8e706622c388c16d25c21048c35b3a08a9096449.tar.gz
slx-admin-8e706622c388c16d25c21048c35b3a08a9096449.tar.xz
slx-admin-8e706622c388c16d25c21048c35b3a08a9096449.zip
[statistics] Track firmware used by clients and display in machine details
Diffstat (limited to 'modules-available/statistics/install.inc.php')
-rw-r--r--modules-available/statistics/install.inc.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php
index bc8a5c91..e9d7e9cb 100644
--- a/modules-available/statistics/install.inc.php
+++ b/modules-available/statistics/install.inc.php
@@ -47,6 +47,7 @@ $res[] = tableCreate('machine', "
`hostname` varchar(200) NOT NULL DEFAULT '',
`currentsession` varchar(120) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`currentuser` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
+ `firmware` varchar(4) CHARACTER SET ascii NOT NULL DEFAULT '',
`notes` text,
PRIMARY KEY (`machineuuid`),
KEY `macaddr` (`macaddr`),
@@ -367,5 +368,15 @@ if (stripos(tableColumnType('statistic', 'data'), 'blob') === false) {
$res[] = UPDATE_DONE;
}
+// 2024-12-16: Add firmware column
+if (!tableHasColumn('machine', 'firmware')) {
+ $ret = Database::exec("ALTER TABLE `machine`
+ ADD COLUMN `firmware` varchar(4) CHARACTER SET ascii NOT NULL DEFAULT ''");
+ if ($ret === false) {
+ finalResponse(UPDATE_FAILED, 'Adding firmware column to machine table failed: ' . Database::lastError());
+ }
+ $res[] = UPDATE_DONE;
+}
+
// Create response
responseFromArray($res);