Changeset 70
- Timestamp:
- Jun 30, 2016, 9:24:21 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Measure/Measure.php
r69 r70 19 19 { 20 20 $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 21 53 } 22 54 } -
trunk/Packages/Common/Setup.php
r69 r70 415 415 PRIMARY KEY (`Id`) 416 416 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 417 $this->Database->query( "INSERT INTO `'.$this->UpdateManager->VersionTable.'` (`Id`, `Revision`) VALUES418 (1, '.$DatabaseRevision.'); ");417 $this->Database->query('INSERT INTO `'.$this->UpdateManager->VersionTable.'` (`Id`, `Revision`) VALUES 418 (1, '.$DatabaseRevision.');'); 419 419 $this->Database->query("CREATE TABLE IF NOT EXISTS `Module` ( 420 420 `Id` int(11) NOT NULL AUTO_INCREMENT, … … 428 428 { 429 429 $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.'`'); 432 432 } 433 433
Note:
See TracChangeset
for help on using the changeset viewer.