diff options
Diffstat (limited to 'modules-available/statistics/install.inc.php')
-rw-r--r-- | modules-available/statistics/install.inc.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php index 99cc8277..5856c81e 100644 --- a/modules-available/statistics/install.inc.php +++ b/modules-available/statistics/install.inc.php @@ -41,7 +41,8 @@ $res[] = tableCreate('machine', " `systemmodel` varchar(120) NOT NULL DEFAULT '', `id44mb` int(10) unsigned NOT NULL, `badsectors` int(10) unsigned NOT NULL, - `data` mediumtext NOT NULL, + `data` mediumblob NOT NULL, + `dataparsetime` int(10) unsigned NOT NULL DEFAULT 0, `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, @@ -76,6 +77,7 @@ $res[] = tableCreate('machine_x_hw_prop', " `machinehwid` int(10) unsigned NOT NULL, `prop` varchar(64) CHARACTER SET ascii NOT NULL, `value` varchar(500) NOT NULL, + `numeric` bigint(20) DEFAULT NULL, PRIMARY KEY (`machinehwid`,`prop`) "); @@ -91,6 +93,7 @@ $res[] = tableCreate('statistic_hw_prop', " `hwid` int(10) unsigned NOT NULL, `prop` varchar(64) CHARACTER SET ascii NOT NULL, `value` varchar(500) NOT NULL, + `numeric` bigint(20) DEFAULT NULL, PRIMARY KEY (`hwid`,`prop`) "); @@ -300,14 +303,18 @@ if (!tableHasColumn('machine', 'live_id45size')) { } // 2021-08-19 Enhanced machine property indexing if (stripos(tableColumnType('statistic_hw_prop', 'prop'), 'varchar(64)') === false) { - $ret = Database::exec("ALTER TABLE statistic_hw_prop MODIFY `prop` varchar(64) CHARACTER SET ascii NOT NULL"); + $ret = Database::exec("ALTER TABLE statistic_hw_prop + MODIFY `prop` varchar(64) CHARACTER SET ascii NOT NULL, + ADD `numeric` bigint(20) DEFAULT NULL"); if ($ret === false) { finalResponse(UPDATE_FAILED, 'Changing prop of statistic_hw_prop failed: ' . Database::lastError()); } $res[] = UPDATE_DONE; } if (stripos(tableColumnType('machine_x_hw_prop', 'prop'), 'varchar(64)') === false) { - $ret = Database::exec("ALTER TABLE machine_x_hw_prop MODIFY `prop` varchar(64) CHARACTER SET ascii NOT NULL"); + $ret = Database::exec("ALTER TABLE machine_x_hw_prop + MODIFY `prop` varchar(64) CHARACTER SET ascii NOT NULL, + ADD `numeric` bigint(20) DEFAULT NULL"); if ($ret === false) { finalResponse(UPDATE_FAILED, 'Changing prop of machine_x_hw_prop failed: ' . Database::lastError()); } @@ -328,5 +335,13 @@ if (stripos(tableColumnType('machine_x_hw', 'devpath'), 'char(32)') === false) { } $res[] = UPDATE_DONE; } +if (!tableHasColumn('machine', 'dataparsetime')) { + $ret = Database::exec("ALTER TABLE `machine` + ADD COLUMN `dataparsetime` int(10) unsigned NOT NULL DEFAULT '0' AFTER `data`"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding mem-stat columns to machine table failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} // Create response responseFromArray($res); |