Ignore:
Timestamp:
Jul 19, 2014, 1:21:24 AM (10 years ago)
Author:
chronos
Message:
  • Upraveno: Příprava pro sledování signálu bezdrátových spojů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r668 r671  
    759759  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
    760760    "VALUES (NULL , 'Kontakty', '12', '".$ActionId."', '1');");
    761   $ConatctMenuId = $Manager->Database->insert_id;
     761  $ContactMenuId = $Manager->Database->insert_id;
    762762
    763763  $Manager->Execute("INSERT INTO `Action` (
     
    767767  $ActionId = $Manager->Database->insert_id;
    768768  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
    769     "VALUES (NULL , 'Druhy kontaktů', ".$ConatctMenuId.", '".$ActionId."', '1');");
     769    "VALUES (NULL , 'Druhy kontaktů', ".$ContactMenuId.", '".$ActionId."', '1');");
    770770
    771771  $Manager->Execute("INSERT INTO `ContactCategory` (`Id` ,`Name`)
     
    797797  $Manager->Execute('INSERT INTO `Module` (`Id` ,`Name` ,`Title`)
    798798VALUES (NULL , "RSS", "RSS kanály");');
     799}
     800
     801function UpdateTo671($Manager)
     802{
     803  $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkSignal` (
     804  `Id` int(11) NOT NULL AUTO_INCREMENT,
     805  `Time` datetime NOT NULL,
     806  `MAC` varchar(17) NOT NULL,
     807  `Interface` int(11) DEFAULT NULL,
     808  `Value` int(11) NOT NULL,
     809  PRIMARY KEY (`Id`),
     810  KEY `Interface` (`Interface`)
     811) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     812
     813  $Manager->Execute('ALTER TABLE `NetworkSignal`
     814  ADD CONSTRAINT `NetworkSignal_ibfk_1` FOREIGN KEY (`Interface`) REFERENCES `NetworkInterface` (`Id`);');
     815  $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,
     816`Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES (
     817NULL , "", "Signál rozhraní", "1", "/is/?t=NetworkSignal&a=list", NULL , NULL , NULL , "1");');
     818  $ActionId = $Manager->Database->insert_id;
     819  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     820    "VALUES (NULL , 'Signál rozhraní', 4, '".$ActionId."', '1');");
     821
     822  $Manager->Execute('ALTER TABLE `NetworkDevice` ADD `API` INT NULL ,ADD INDEX ( `API` ) ;');
     823  $Manager->Execute('CREATE TABLE IF NOT EXISTS `DeviceAPIType` (
     824  `Id` int(11) NOT NULL AUTO_INCREMENT,
     825  `Name` varchar(255) NOT NULL,
     826  PRIMARY KEY (`Id`)
     827) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;');
     828
     829  $Manager->Execute('INSERT INTO `DeviceAPIType` (`Id`, `Name`) VALUES
     830(1, "RouterOS API"),
     831(2, "AirOS");');
     832  $Manager->Execute('ALTER TABLE `NetworkDevice` ADD FOREIGN KEY ( `API` ) REFERENCES `DeviceAPIType` (
     833`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;');
     834
    799835}
    800836
     
    842878      661 => array('Revision' => 662, 'Function' => 'UpdateTo662'),
    843879      662 => array('Revision' => 668, 'Function' => 'UpdateTo668'),
     880      668 => array('Revision' => 671, 'Function' => 'UpdateTo671'),
    844881    ));
    845882  }
Note: See TracChangeset for help on using the changeset viewer.