Changeset 97 for trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
- Timestamp:
- Oct 2, 2012, 9:42:35 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
r92 r97 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem ;8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 9 9 10 10 type … … 72 72 begin 73 73 inherited Stop; 74 with Core.Pages do begin 75 UnregisterPage('internet'); 76 UnregisterPage('hosting'); 77 UnregisterPage('historie'); 78 UnregisterPage('dokumenty'); 79 UnregisterPage('voip'); 80 UnregisterPage('odkazy'); 81 UnregisterPage('kontakt'); 82 UnregisterPage('serverinfo'); 83 UnregisterPage('kamery'); 84 UnregisterPage('plany'); 85 UnregisterPage('sit'); 86 UnregisterPage('projekty'); 87 UnregisterPage(''); 88 end; 74 89 end; 75 90 76 91 procedure TModuleZdechovNET.Install; 92 var 93 DbRows: TDbRows; 94 Data: TDictionaryStringString; 77 95 begin 96 try 97 DbRows := TDbRows.Create; 98 Data := TDictionaryStringString.Create; 99 100 Core.CommonDatabase.Query(DbRows, 101 'CREATE TABLE IF NOT EXISTS `VPSHosting` (' + 102 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 103 ' `Name` varchar(255) NOT NULL,' + 104 ' `Memory` varchar(255) NOT NULL,' + 105 ' `Space` varchar(255) NOT NULL,' + 106 ' `Internet` varchar(255) NOT NULL,' + 107 ' `CPU` varchar(255) NOT NULL,' + 108 ' `Price` int(11) NOT NULL,' + 109 ' PRIMARY KEY (`Id`)' + 110 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 111 112 Core.CommonDatabase.Query(DbRows, 113 'CREATE TABLE IF NOT EXISTS `History` (' + 114 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 115 ' `Date` date NOT NULL,' + 116 ' `Text` text COLLATE utf8_czech_ci NOT NULL,' + 117 ' PRIMARY KEY (`Id`)' + 118 ') ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 119 120 Core.CommonDatabase.Query(DbRows, 121 'CREATE TABLE IF NOT EXISTS `Webcam` (' + 122 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 123 ' `Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' + 124 ' `Description` text CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' + 125 ' `ImageName` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' + 126 ' `ImageURL` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' + 127 ' `ImagePeriod` int(11) NOT NULL,' + 128 ' `Width` int(11) NOT NULL,' + 129 ' `Height` int(11) NOT NULL,' + 130 ' `Enabled` int(11) NOT NULL DEFAULT "1",' + 131 ' `DeviceType` varchar(255) NOT NULL,' + 132 ' PRIMARY KEY (`Id`)' + 133 ') ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 134 135 Core.CommonDatabase.Query(DbRows, 136 ' CREATE TABLE IF NOT EXISTS `Plans` (' + 137 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 138 ' `TimeCreate` datetime NOT NULL,' + 139 ' `TimeFinished` datetime DEFAULT NULL,' + 140 ' `Description` text COLLATE utf8_czech_ci NOT NULL,' + 141 ' `Conclusion` text COLLATE utf8_czech_ci NOT NULL,' + 142 ' `Public` int(11) NOT NULL DEFAULT "0",' + 143 ' PRIMARY KEY (`Id`),' + 144 ' KEY `TimeCreate` (`TimeCreate`),' + 145 ' KEY `TimeFinished` (`TimeFinished`)' + 146 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 147 148 finally 149 Data.Free; 150 DbRows.Free; 151 end; 152 78 153 inherited Install; 79 154 end; 80 155 81 156 procedure TModuleZdechovNET.Uninstall; 157 var 158 DbRows: TDbRows; 82 159 begin 83 160 inherited Uninstall; 161 try 162 DbRows := TDbRows.Create; 163 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `Plans`'); 164 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `Webcam`'); 165 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `VPSHosting`'); 166 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `History`'); 167 finally 168 DbRows.Free; 169 end; 84 170 end; 85 171
Note:
See TracChangeset
for help on using the changeset viewer.