Ignore:
Timestamp:
May 16, 2014, 10:44:07 PM (11 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení tabulky seznamu měření.
  • Opraveno: Přidávání nových hodnot přes web.
File:
1 edited

Legend:

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

    r649 r656  
    22
    33function UpdateTo493($Manager)
    4 {     
     4{
    55  $Manager->Execute("ALTER TABLE `UserOnline` CHANGE `User` `User` INT( 11 ) NULL DEFAULT NULL COMMENT 'User.Id'");
    66}
    77
    88function UpdateTo494($Manager)
    9 {     
     9{
    1010  $Manager->Execute("ALTER TABLE `FinanceOperation` DROP FOREIGN KEY `FinanceOperation_ibfk_2` ;\n".
    1111    "ALTER TABLE `FinanceOperation` CHANGE `Bill` `File` INT( 11 ) NULL DEFAULT NULL;\n".
     
    183183  `Message` varchar(255) NOT NULL DEFAULT '',
    184184  PRIMARY KEY (`Id`)
    185 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 
     185) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
    186186}
    187187
     
    201201  $Manager->Execute("INSERT INTO `ServiceCategory` (
    202202`Id` ,`Name`) VALUES (NULL , 'Pevný nájem');");
    203   $ServiceCategoryHire = $Manager->Database->insert_id; 
     203  $ServiceCategoryHire = $Manager->Database->insert_id;
    204204  $DbResult = $Manager->Execute("SELECT * FROM Member WHERE Hire>0");
    205205  while($Member = $DbResult->fetch_assoc())
     
    211211NULL , 'Nájem', '".$ServiceCategoryHire."', '-".$Member['Hire']."', '2', '', NULL , NULL , '', '', '', '', '', '', '', ''
    212212);");
    213     $ServiceHire = $Manager->Database->insert_id; 
    214     $Manager->Execute("INSERT INTO `ServiceCustomerRel` (`Service`, `Customer`) VALUES ". 
     213    $ServiceHire = $Manager->Database->insert_id;
     214    $Manager->Execute("INSERT INTO `ServiceCustomerRel` (`Service`, `Customer`) VALUES ".
    215215      "(".$ServiceHire.",".$Member['Id'].")");
    216216  }
     
    226226  $Manager->Execute("ALTER TABLE `NetworkSubnet` ADD FOREIGN KEY ( `Service` ) REFERENCES `ServiceCustomerRel` (
    227227`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;");
    228   $Manager->Execute("UPDATE `NetworkSubnet` SET `Service` = (SELECT `Id` FROM `ServiceCustomerRel` WHERE `ServiceCustomerRel`.`Customer` = `NetworkSubnet`.`Member` LIMIT 1)"); 
     228  $Manager->Execute("UPDATE `NetworkSubnet` SET `Service` = (SELECT `Id` FROM `ServiceCustomerRel` WHERE `ServiceCustomerRel`.`Customer` = `NetworkSubnet`.`Member` LIMIT 1)");
    229229}
    230230
     
    252252      PRIMARY KEY (`Id`)
    253253  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
    254  
     254
    255255  INSERT INTO `ActionType` (`Id`, `Name`) VALUES
    256256  (1, 'Odkaz'),
     
    301301  $ActionId = $Manager->Database->insert_id;
    302302  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
    303     "VALUES (NULL , 'Nabídky', '23', '".$ActionId."', '1');"); 
     303    "VALUES (NULL , 'Nabídky', '23', '".$ActionId."', '1');");
    304304}
    305305
     
    310310  while($DbRow = $DbResult->fetch_row())
    311311  {
    312     $Manager->Execute("ALTER TABLE `".$DbRow[0]."` CONVERT TO CHARACTER SET utf8"); 
    313   } 
     312    $Manager->Execute("ALTER TABLE `".$DbRow[0]."` CONVERT TO CHARACTER SET utf8");
     313  }
    314314}
    315315
     
    323323
    324324function UpdateTo550($Manager)
    325 { 
     325{
    326326  $Manager->Execute('ALTER TABLE `FinanceBankAccount` ADD `LastImportId` VARCHAR( 255 ) NOT NULL ;');
    327327  $Manager->Execute('ALTER TABLE `FinanceBankAccount` ADD `LastImportDate` DATE NULL ;');
     
    330330
    331331function UpdateTo551($Manager)
    332 { 
     332{
    333333  $Manager->Execute('ALTER TABLE `FinanceOperation` ADD `DocumentLine` INT NULL AFTER `Value` ,
    334334ADD INDEX ( `DocumentLine` ) ;');
     
    344344
    345345function UpdateTo565($Manager)
    346 { 
     346{
    347347  $Manager->Execute('CREATE TABLE IF NOT EXISTS `WikiPage` (
    348348    `Id` int(11) NOT NULL AUTO_INCREMENT,
     
    370370
    371371function UpdateTo571($Manager)
    372 { 
     372{
    373373  $Manager->Execute('ALTER TABLE `NetworkDevice` ADD `LoginName` VARCHAR( 255 ) NOT NULL ,
    374374ADD `LoginPassword` VARCHAR( 255 ) NOT NULL ;');
     
    391391      PRIMARY KEY (`Id`)
    392392  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;");
    393  
     393
    394394  $Manager->Execute("INSERT INTO `Module` (`Id`, `Name`, `Title`) VALUES
    395395  (1, 'Customer', 'Zákazník'),
     
    647647}
    648648
     649function UpdateTo656($Manager)
     650{
     651        $Manager->Execute('CREATE TABLE IF NOT EXISTS `Measure` (
     652  `Id` int(11) NOT NULL AUTO_INCREMENT,
     653  `Name` varchar(255) NOT NULL,
     654  `Method` int(11) NOT NULL,
     655  `Continuity` int(11) NOT NULL,
     656  `Period` int(11) NOT NULL,
     657  `Enabled` int(11) NOT NULL,
     658  `Description` text NOT NULL,
     659  `DataType` varchar(255) NOT NULL,
     660  `DataTable` varchar(255) NOT NULL,
     661  `Group` int(11) DEFAULT NULL,
     662  `Cumulative` int(11) NOT NULL DEFAULT "0",
     663  PRIMARY KEY (`Id`),
     664  KEY `Group` (`Group`),
     665  KEY `Method` (`Method`)
     666) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     667
     668  $Manager->Execute('CREATE TABLE IF NOT EXISTS `MeasureData` (
     669  `Id` int(11) NOT NULL AUTO_INCREMENT,
     670  `Time` datetime NOT NULL,
     671  `Level` int(11) NOT NULL,
     672  `Measure` int(11) NOT NULL,
     673  `Continuity` int(11) NOT NULL,
     674  `Min` int(11) NOT NULL,
     675  `Avg` int(11) NOT NULL,
     676  `Max` int(11) NOT NULL,
     677  PRIMARY KEY (`Id`),
     678  KEY `Time` (`Time`),
     679  KEY `Measure` (`Measure`)
     680) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     681
     682  $Manager->Execute('CREATE TABLE IF NOT EXISTS `MeasureGroup` (
     683  `Id` int(11) NOT NULL AUTO_INCREMENT,
     684  `Name` varchar(255) NOT NULL,
     685  `Parent` int(11) DEFAULT NULL,
     686  PRIMARY KEY (`Id`),
     687  KEY `Parent` (`Parent`)
     688) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     689
     690  $Manager->Execute('CREATE TABLE IF NOT EXISTS `MeasureMethod` (
     691  `Id` int(11) NOT NULL AUTO_INCREMENT,
     692  `Name` varchar(255) NOT NULL,
     693  `Unit` varchar(255) NOT NULL,
     694  PRIMARY KEY (`Id`)
     695) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     696
     697  $Manager->Execute('ALTER TABLE `Measure`
     698  ADD CONSTRAINT `Measure_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `MeasureGroup` (`Id`),
     699  ADD CONSTRAINT `Measure_ibfk_2` FOREIGN KEY (`Method`) REFERENCES `MeasureMethod` (`Id`);');
     700
     701  $Manager->Execute('ALTER TABLE `MeasureData`
     702  ADD CONSTRAINT `MeasureData_ibfk_1` FOREIGN KEY (`Measure`) REFERENCES `Measure` (`Id`);');
     703
     704  $Manager->Execute('ALTER TABLE `MeasureGroup`
     705  ADD CONSTRAINT `MeasureGroup_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `MeasureGroup` (`Id`);');
     706}
    649707
    650708class Updates
Note: See TracChangeset for help on using the changeset viewer.