Changeset 718 for trunk/Common/Setup/Updates.php
- Timestamp:
- Jan 1, 2015, 3:22:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Setup/Updates.php
r715 r718 1001 1001 $Manager->Execute('ALTER TABLE `Member` DROP `NetworkSegment`'); 1002 1002 $Manager->Execute('DROP TABLE `NetworkSegment`'); 1003 $Manager->Execute('DELETE FROM `MenuItem` WHERE `Name`="Úseky sítě"'); 1004 $Manager->Execute('DELETE FROM `Action` WHERE `Title`="Úseky sítě"'); 1005 } 1006 1007 function UpdateTo718($Manager) 1008 { 1009 $Manager->Execute('CREATE TABLE IF NOT EXISTS `Company` ( 1010 `Id` int(11) NOT NULL, 1011 `Name` varchar(255) NOT NULL, 1012 `Subject` int(11) NOT NULL 1013 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 1014 $Manager->Execute('ALTER TABLE `Company` 1015 ADD PRIMARY KEY (`Id`), ADD KEY `Subject` (`Subject`);'); 1016 $Manager->Execute('ALTER TABLE `Company` 1017 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;'); 1018 $Manager->Execute('ALTER TABLE `Company` 1019 ADD CONSTRAINT `Company_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);'); 1020 1021 // IS menu item 1022 $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` , 1023 `Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES ( 1024 NULL , "", "Firmy", "1", "/is/?t=Company&a=list", NULL , NULL , NULL , "1");'); 1025 $ActionId = $Manager->Database->insert_id; 1026 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Finance"'); 1027 if($DbResult->num_rows > 0) 1028 { 1029 $DbRow = $DbResult->fetch_assoc(); 1030 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 1031 "VALUES (NULL , 'Firmy', ".$DbRow['Id'].", '".$ActionId."', '1');"); 1032 } 1003 1033 } 1004 1034 … … 1057 1087 697 => array('Revision' => 707, 'Function' => 'UpdateTo707'), 1058 1088 710 => array('Revision' => 715, 'Function' => 'UpdateTo715'), 1089 715 => array('Revision' => 718, 'Function' => 'UpdateTo718'), 1059 1090 )); 1060 1091 }
Note:
See TracChangeset
for help on using the changeset viewer.