diff options
author | Simon Rettberg | 2017-12-01 13:42:04 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-12-01 13:42:04 +0100 |
commit | 5393703f6e1485ddff94a50f63bcdd216ab629f4 (patch) | |
tree | ce2db7130302bd4fb78b170e1fbd75496a1b4510 /modules-available/dnbd3/install.inc.php | |
parent | Merge remote-tracking branch 'origin/permission-manager' into permission-manager (diff) | |
parent | [roomplanner] Sort already placed machines to the bottom (diff) | |
download | slx-admin-5393703f6e1485ddff94a50f63bcdd216ab629f4.tar.gz slx-admin-5393703f6e1485ddff94a50f63bcdd216ab629f4.tar.xz slx-admin-5393703f6e1485ddff94a50f63bcdd216ab629f4.zip |
Merge branch 'master' into permission-manager
Diffstat (limited to 'modules-available/dnbd3/install.inc.php')
-rw-r--r-- | modules-available/dnbd3/install.inc.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules-available/dnbd3/install.inc.php b/modules-available/dnbd3/install.inc.php new file mode 100644 index 00000000..c5096cfe --- /dev/null +++ b/modules-available/dnbd3/install.inc.php @@ -0,0 +1,41 @@ +<?php + +$res = array(); + +$res[] = tableCreate('dnbd3_server', " + `serverid` int(11) NOT NULL AUTO_INCREMENT, + `machineuuid` char(36) CHARACTER SET ascii DEFAULT NULL, + `fixedip` varchar(45) CHARACTER SET ascii DEFAULT NULL, + `runid` bigint(20) NOT NULL DEFAULT '0', + `lastseen` bigint(20) NOT NULL DEFAULT '0', + `uptime` bigint(20) NOT NULL DEFAULT '0', + `totalup` bigint(20) NOT NULL DEFAULT '0', + `totaldown` bigint(20) NOT NULL DEFAULT '0', + `lastup` bigint(20) NOT NULL DEFAULT '0', + `lastdown` bigint(20) NOT NULL DEFAULT '0', + `clientcount` int(11) NOT NULL DEFAULT '0', + `disktotal` bigint(20) NOT NULL DEFAULT '0', + `diskfree` bigint(20) NOT NULL DEFAULT '0', + `errormsg` varchar(200) DEFAULT NULL, + PRIMARY KEY (`serverid`), + UNIQUE KEY `machineuuid` (`machineuuid`), + UNIQUE KEY `fixedip` (`fixedip`) +"); + +$res[] = tableCreate('dnbd3_server_x_location', ' + `serverid` int(11) NOT NULL, + `locationid` int(11) NOT NULL, + PRIMARY KEY (`serverid`,`locationid`), + KEY `locationid` (`locationid`) +'); + +$res[] = tableAddConstraint('dnbd3_server', 'machineuuid', 'machine', 'machineuuid', + 'ON UPDATE CASCADE ON DELETE CASCADE'); + +$res[] = tableAddConstraint('dnbd3_server_x_location', 'locationid', 'location', 'locationid', + 'ON UPDATE CASCADE ON DELETE CASCADE'); + +$res[] = tableAddConstraint('dnbd3_server_x_location', 'serverid', 'dnbd3_server', 'serverid', + 'ON UPDATE CASCADE ON DELETE CASCADE'); + +responseFromArray($res); |