Changeset 584 for trunk/admin/Updates.php
- Timestamp:
- Oct 31, 2013, 4:57:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/Updates.php
r574 r584 383 383 } 384 384 385 function UpdateTo584($Manager) 386 { 387 $Manager->Execute("CREATE TABLE IF NOT EXISTS `Module` ( 388 `Id` int(11) NOT NULL AUTO_INCREMENT, 389 `Name` varchar(255) NOT NULL, 390 `Title` varchar(255) NOT NULL, 391 PRIMARY KEY (`Id`) 392 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;"); 393 394 $Manager->Execute("INSERT INTO `Module` (`Id`, `Name`, `Title`) VALUES 395 (1, 'Customer', 'Zákazník'), 396 (2, 'EmailQueue', 'Fronta emailů'), 397 (3, 'Error', 'Obsluha chyb'), 398 (4, 'File', 'Správa souborů'), 399 (5, 'Finance', 'Finance'), 400 (6, 'FinanceBankAPI', 'Rozhraní pro bankovní účty'), 401 (7, 'Chat', 'Pokec'), 402 (8, 'IS', 'Informační systém'), 403 (9, 'Log', 'Záznam událostí'), 404 (10, 'Map', 'Mapa'), 405 (11, 'Meals', 'Jídelníček'), 406 (12, 'Meteostation', 'Meteostanice'), 407 (13, 'Network', 'Síť'), 408 (14, 'NetworkConfig', 'Nastavení sítě'), 409 (15, 'NetworkConfigLinux', 'Nastavení linuxových zařízení'), 410 (16, 'NetworkConfigRouterOS', 'Nastavení RouterOS zařízení'), 411 (17, 'NetworkShare', 'Síťové sdílení'), 412 (18, 'NetworkTopology', 'Síťová topologie'), 413 (19, 'News', 'Aktuality'), 414 (20, 'OpeningHours', 'Otvírací doby'), 415 (21, 'Portal', 'Portál'), 416 (22, 'Search', 'Vyhledávání'), 417 (23, 'Setup', 'Instalace systému'), 418 (24, 'SpeedTest', 'Měření rychlosti'), 419 (25, 'Stock', 'Sklad'), 420 (26, 'System', 'Systém'), 421 (27, 'Task', 'Úlohy'), 422 (28, 'TimeMeasure', 'Časové průběhy'), 423 (29, 'TV', 'Televize'), 424 (30, 'User', 'Uživatelé'), 425 (31, 'WebCam', 'Web kamery'), 426 (32, 'Wiki', 'Wiki');"); 427 $Manager->Execute("UPDATE `PermissionOperation` SET `Module` = 'Meals' WHERE `PermissionOperation`.`Module` ='EatingPlace';"); 428 $Manager->Execute("UPDATE `PermissionOperation` SET `Module` = 'NetworkShare' WHERE `PermissionOperation`.`Module` ='Share';"); 429 $Manager->Execute("UPDATE `PermissionOperation` SET `Module` = 'SubjectOpenTime' WHERE `PermissionOperation`.`Module` ='OpeningHours';"); 430 $Manager->Execute("UPDATE `PermissionOperation` SET `Module`=(SELECT `Id` FROM `Module` WHERE `Module`.`Name` = `PermissionOperation`.`Module`)"); 431 $Manager->Execute("ALTER TABLE `PermissionOperation` CHANGE `Module` `Module` INT( 11 ) NOT NULL ;"); 432 $Manager->Execute("ALTER TABLE `PermissionOperation` ADD FOREIGN KEY ( `Module` ) REFERENCES `Module` ( 433 `Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 434 $Manager->Execute("UPDATE `Action` SET `Action`.`PermissionOperation` =(SELECT Id FROM `PermissionOperation` WHERE `PermissionOperation`.`Operation`=`Action`.`PermissionOperation` AND `PermissionOperation`.`Module` = (SELECT Id FROM `Module` WHERE `Module`.`Name`=`Action`.`PermissionModule`))"); 435 $Manager->Execute("ALTER TABLE `Action` CHANGE `PermissionOperation` `PermissionOperation` INT( 11 ) NULL ;"); 436 $Manager->Execute("ALTER TABLE `Action` DROP `PermissionModule` ;"); 437 $Manager->Execute("UPDATE `Action` SET `PermissionOperation`=NULL WHERE `PermissionOperation`=0"); 438 $Manager->Execute("ALTER TABLE `Action` ADD INDEX (`PermissionOperation`);"); 439 $Manager->Execute("ALTER TABLE `Action` ADD FOREIGN KEY ( `PermissionOperation` ) REFERENCES `PermissionOperation` ( 440 `Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 441 } 442 443 385 444 $Updates = array( 386 445 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), … … 405 464 565 => array('Revision' => 571, 'Function' => 'UpdateTo571'), 406 465 571 => array('Revision' => 574, 'Function' => 'UpdateTo574'), 466 574 => array('Revision' => 584, 'Function' => 'UpdateTo584'), 407 467 );
Note:
See TracChangeset
for help on using the changeset viewer.