Changeset 646 for trunk/Common/Setup/Updates.php
- Timestamp:
- Mar 25, 2014, 12:35:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Setup/Updates.php
r645 r646 576 576 } 577 577 578 function UpdateTo646($Manager) 579 { 580 $Manager->Execute('CREATE TABLE IF NOT EXISTS `Contract` ( 581 `Id` int(11) NOT NULL AUTO_INCREMENT, 582 `BillCode` varchar(255) NOT NULL, 583 `Subject` int(11) NOT NULL, 584 `DocumentLine` int(11) NOT NULL, 585 `ValidFrom` date NOT NULL, 586 `ValidTo` date DEFAULT NULL, 587 `File` int(11) DEFAULT NULL, 588 PRIMARY KEY (`Id`), 589 KEY `Subject` (`Subject`), 590 KEY `DocumentLine` (`DocumentLine`), 591 KEY `File` (`File`) 592 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 593 $Manager->Execute('ALTER TABLE `Contract` 594 ADD CONSTRAINT `Contract_ibfk_3` FOREIGN KEY (`File`) REFERENCES `File` (`Id`), 595 ADD CONSTRAINT `Contract_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`), 596 ADD CONSTRAINT `Contract_ibfk_2` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`); 597 '); 598 $Manager->Execute("INSERT INTO `Action` ( 599 `Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` , 600 `Enable`) VALUES (NULL , '', 'Smlouvy', '1', '/is/?t=Contract&a=list', NULL , NULL , NULL , '1' 601 );"); 602 $ActionId = $Manager->Database->insert_id; 603 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 604 "VALUES (NULL , 'Smlouvy', '2', '".$ActionId."', '1');"); 605 $Manager->Execute("INSERT INTO `Action` ( 606 `Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` , 607 `Enable`) VALUES (NULL , '', 'Sazby DPH', '1', '/is/?t=FinanceVAT&a=list', NULL , NULL , NULL , '1' 608 );"); 609 $ActionId = $Manager->Database->insert_id; 610 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 611 "VALUES (NULL , 'Sazby DPH', '2', '".$ActionId."', '1');"); 612 } 613 578 614 579 615 class Updates … … 614 650 632 => array('Revision' => 633, 'Function' => 'UpdateTo633'), 615 651 633 => array('Revision' => 645, 'Function' => 'UpdateTo645'), 652 645 => array('Revision' => 646, 'Function' => 'UpdateTo646'), 616 653 )); 617 654 }
Note:
See TracChangeset
for help on using the changeset viewer.