diff --git a/lib/upgradedb/mysql.2015120200.php b/lib/upgradedb/mysql.2015120200.php index 25c4c33..7403466 100644 --- a/lib/upgradedb/mysql.2015120200.php +++ b/lib/upgradedb/mysql.2015120200.php @@ -23,20 +23,24 @@ $this->BeginTrans(); -$this->Execute("DROP VIEW vnodes; DROP VIEW vmacs; DROP VIEW IF EXISTS vnetworks"); +$this->Execute("DROP VIEW vnodes;"); +$this->Execute("DROP VIEW vmacs;"); +$this->Execute("DROP VIEW IF EXISTS vnetworks"); $this->Execute(" CREATE VIEW vnodes AS SELECT n.*, m.mac FROM nodes n LEFT JOIN vnodes_mac m ON (n.id = m.nodeid) - WHERE n.ipaddr <> 0 AND n.ipaddr_pub <> 0; + WHERE n.ipaddr <> 0 AND n.ipaddr_pub <> 0;"); +$this->Execute(" CREATE VIEW vmacs AS SELECT n.*, m.mac, m.id AS macid FROM nodes n JOIN macs m ON (n.id = m.nodeid) - WHERE n.ipaddr <> 0 AND n.ipaddr_pub <> 0; + WHERE n.ipaddr <> 0 AND n.ipaddr_pub <> 0;"); +$this->Execute(" CREATE VIEW vnetworks AS SELECT h.name AS hostname, ne.*, no.ownerid, no.location, no.location_city, no.location_street, no.location_house, no.location_flat, no.chkmac, " . $this->Concat('inet_ntoa(ne.address)', "'/'", 'mask2prefix(inet_aton(ne.mask))') . " AS ip diff --git a/lib/upgradedb/mysql.2015120201.php b/lib/upgradedb/mysql.2015120201.php index 0751bce..d55a145 100644 --- a/lib/upgradedb/mysql.2015120201.php +++ b/lib/upgradedb/mysql.2015120201.php @@ -23,14 +23,15 @@ $this->BeginTrans(); -$this->Execute("DROP VIEW vnodes; DROP VIEW vmacs;"); +$this->Execute("DROP VIEW vnodes;"); +$this->Execute("DROP VIEW vmacs;"); $this->Execute(" CREATE VIEW vnodes AS SELECT n.*, m.mac FROM nodes n LEFT JOIN vnodes_mac m ON (n.id = m.nodeid) - WHERE n.ipaddr <> 0 OR n.ipaddr_pub <> 0; - + WHERE n.ipaddr <> 0 OR n.ipaddr_pub <> 0;"); +$this->Execute(" CREATE VIEW vmacs AS SELECT n.*, m.mac, m.id AS macid FROM nodes n diff --git a/lib/upgradedb/mysql.2015122301.php b/lib/upgradedb/mysql.2015122301.php index da079c7..d816e12 100644 --- a/lib/upgradedb/mysql.2015122301.php +++ b/lib/upgradedb/mysql.2015122301.php @@ -31,7 +31,7 @@ $this->Execute(" userid int(11) NOT NULL, hash varchar(255) DEFAULT '' NOT NULL, FOREIGN KEY (userid) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE, - PRIMARY KEY (id), + PRIMARY KEY (id)); "); $this->Execute("INSERT INTO uiconfig (section, var, value) VALUES(?, ?, ?)", array('phpui', 'passwordhistory', 6)); $this->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2015122301', 'dbversion'));