Ignore:
Timestamp:
Mar 9, 2016, 10:07:18 PM (9 years ago)
Author:
chronos
Message:
  • Added: Notify callback for checking state of network ports. Network ports can be defined as subtable under network interface.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r808 r814  
    19461946        "VALUES (NULL , 'Kontrola pokladen', ".$DbRow['Id'].", '".$ActionId."', '1');");
    19471947  }
    1948 
     1948}
     1949
     1950function UpdateTo814($Manager)
     1951{
     1952  $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkPort` (
     1953    `Id` int(11) NOT NULL AUTO_INCREMENT,
     1954    `Name` varchar(255) NOT NULL,
     1955    `Interface` int(11) NOT NULL,
     1956    `Number` int(11) NOT NULL,
     1957    `Enabled` int(11) NOT NULL,
     1958    `Online` int(11) NOT NULL,
     1959    `LastOnline` datetime NULL,
     1960    `OnlineNotify` int(11) NOT NULL,
     1961    PRIMARY KEY (`Id`),
     1962    KEY `Interface` (`Interface`)
     1963    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
     1964
     1965  $Manager->Execute('ALTER TABLE `NetworkPort`
     1966  ADD CONSTRAINT `NetworkPort_ibfk_1` FOREIGN KEY (`Interface`) REFERENCES `NetworkInterface` (`Id`);');
     1967  $Manager->Execute('ALTER TABLE `NetworkInterface` ADD `Enabled` INT NOT NULL DEFAULT "1" AFTER `OnlineNotify`;');
     1968  $Manager->Execute('ALTER TABLE `NetworkInterface` CHANGE `LastOnline` `LastOnline` DATETIME NULL;');
     1969  $Manager->Execute('UPDATE `NetworkInterface` SET `LastOnline` = NULL WHERE `LastOnline` = "0000-00-00 00:00:00"');
     1970  $Manager->Execute('ALTER TABLE `NetworkDevice` CHANGE `LastOnline` `LastOnline` DATETIME NULL;');
     1971  $Manager->Execute('UPDATE `NetworkDevice` SET `LastOnline` = NULL WHERE `LastOnline` = "0000-00-00 00:00:00"');
    19491972}
    19501973
     
    20372060      803 => array('Revision' => 807, 'Function' => 'UpdateTo807'),
    20382061      807 => array('Revision' => 808, 'Function' => 'UpdateTo808'),
     2062      808 => array('Revision' => 814, 'Function' => 'UpdateTo814'),
    20392063    ));
    20402064  }
Note: See TracChangeset for help on using the changeset viewer.