Changeset 70 for trunk


Ignore:
Timestamp:
Jun 30, 2016, 9:24:21 PM (8 years ago)
Author:
chronos
Message:
  • Added: Missing Measure Page file.
  • Added: Measure module table SQL create and remove.
Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Measure/Measure.php

    r69 r70  
    1919  {
    2020    $this->System->RegisterPage('', 'PageMain');
     21  }
     22 
     23  function DoInstall()
     24  {
     25   $this->Database->query('CREATE TABLE IF NOT EXISTS `Measure` (
     26  `Id` int(11) NOT NULL auto_increment,
     27  `Name` varchar(255) collate utf8_general_ci NOT NULL,
     28  `Description` varchar(255) collate utf8_general_ci NOT NULL,
     29  `Divider` int(11) NOT NULL default 1,
     30  `Unit` varchar(16) collate utf8_general_ci NOT NULL,
     31  `Continuity` tinyint(1) NOT NULL default 0,
     32  `Period` int(11) NOT NULL default 60,
     33  `OldName` varchar(32) collate utf8_general_ci NOT NULL,
     34  `PermissionView` varchar(255) collate utf8_general_ci NOT NULL default "all",
     35  `PermissionAdd` varchar(255) collate utf8_general_ci NOT NULL default "localhost.localdomain",
     36  `Info` varchar(255) collate utf8_general_ci NOT NULL,
     37  `Enabled` int(11) NOT NULL default 1,
     38  `Cumulative` int(11) NOT NULL default 0,
     39  `DataTable` varchar(32) collate utf8_general_ci NOT NULL default "data",
     40  `DataType` varchar(32) collate utf8_general_ci NOT NULL,
     41  PRIMARY KEY  (`Id`)
     42) ENGINE=InnoDB  DEFAULT CHARSET=utf8;');
     43   }
     44 
     45  function DoUninstall()
     46  {
     47    $this->Database->query('DROP TABLE IF EXISTS `Measure`');
     48  }
     49 
     50  function DoUpgrade()
     51  {
     52   
    2153  }
    2254}
  • trunk/Packages/Common/Setup.php

    r69 r70  
    415415  PRIMARY KEY (`Id`)
    416416) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
    417     $this->Database->query("INSERT INTO `'.$this->UpdateManager->VersionTable.'` (`Id`, `Revision`) VALUES
    418       (1, '.$DatabaseRevision.');");
     417    $this->Database->query('INSERT INTO `'.$this->UpdateManager->VersionTable.'` (`Id`, `Revision`) VALUES
     418      (1, '.$DatabaseRevision.');');
    419419    $this->Database->query("CREATE TABLE IF NOT EXISTS `Module` (
    420420  `Id` int(11) NOT NULL AUTO_INCREMENT,
     
    428428  {
    429429    $this->System->ModuleManager->UninstallAll();
    430     $this->Database->query('DROP TABLE `Module`');
    431     $this->Database->query('DROP TABLE `'.$this->UpdateManager->VersionTable.'`');
     430    $this->Database->query('DROP TABLE IF EXISTS `Module`');
     431    $this->Database->query('DROP TABLE IF EXISTS `'.$this->UpdateManager->VersionTable.'`');
    432432  }
    433433
Note: See TracChangeset for help on using the changeset viewer.