Changeset 731 for trunk/Common/Setup/Updates.php
- Timestamp:
- Jan 17, 2015, 9:24:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Setup/Updates.php
r730 r731 1222 1222 $Manager->Execute('ALTER TABLE `Scheduler` ADD CONSTRAINT `Schedule_ibfk_2` FOREIGN KEY (`Action`) REFERENCES `SchedulerAction` (`Id`);'); 1223 1223 $Manager->Execute('INSERT INTO `SchedulerAction` (`Id`, `Name`, `Class`) VALUES (NULL, "Import bankovních účtů", "ScheduleBankImport");'); 1224 } 1225 1226 function UpdateTo731($Manager) 1227 { 1228 // NetworkDomain 1229 $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkDomain` ( 1230 `Id` int(11) NOT NULL, 1231 `Name` varchar(255) NOT NULL, 1232 `Parent` int(11) DEFAULT NULL, 1233 `Serial` int(11) NOT NULL, 1234 `Refresh` int(11) NOT NULL, 1235 `Expire` int(11) NOT NULL, 1236 `Retry` int(11) NOT NULL, 1237 `Minimum` int(11) NOT NULL, 1238 `TTL` int(11) NOT NULL, 1239 `Description` varchar(255) NOT NULL 1240 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 1241 1242 $Manager->Execute('ALTER TABLE `NetworkDomain` ADD PRIMARY KEY (`Id`);'); 1243 1244 $Manager->Execute('ALTER TABLE `NetworkDomain` 1245 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;'); 1246 1247 $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` , 1248 `Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES ( 1249 NULL , "", "Síťová doména", "1", "/is/?t=NetworkDomain&a=list", NULL , NULL , NULL , "1");'); 1250 $ActionId = $Manager->Database->insert_id; 1251 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"'); 1252 if($DbResult->num_rows > 0) 1253 { 1254 $DbRow = $DbResult->fetch_assoc(); 1255 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 1256 "VALUES (NULL , 'Síťová doména', ".$DbRow['Id'].", '".$ActionId."', '1');"); 1257 } 1258 1259 // Model additions 1260 $Manager->Execute('ALTER TABLE `Model` ADD `Title` VARCHAR(255) NOT NULL , '. 1261 'ADD `Query` VARCHAR(255) NOT NULL , '. 1262 'ADD `DefaultSortColumn` VARCHAR(255) NOT NULL , '. 1263 'ADD `DefaultSortOrder` INT NOT NULL ;'); 1264 1265 // ModelField 1266 $Manager->Execute('CREATE TABLE IF NOT EXISTS `ModelField` ( 1267 `Id` int(11) NOT NULL, 1268 `Name` varchar(255) NOT NULL, 1269 `Model` int(11) NOT NULL, 1270 `Query` varchar(255) NOT NULL, 1271 `Type` varchar(255) NOT NULL, 1272 `Title` varchar(255) NOT NULL, 1273 `DefaultValue` varchar(255) NOT NULL, 1274 `IsNull` int(11) NOT NULL, 1275 `Suffix` varchar(255) NOT NULL 1276 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 1277 1278 $Manager->Execute('ALTER TABLE `ModelField` 1279 ADD PRIMARY KEY (`Id`), ADD KEY `Model` (`Model`);'); 1280 1281 $Manager->Execute('ALTER TABLE `ModelField` 1282 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;'); 1283 1284 $Manager->Execute('ALTER TABLE `ModelField` 1285 ADD CONSTRAINT `ModelField_ibfk_1` FOREIGN KEY (`Model`) REFERENCES `Model` (`Id`);'); 1286 1287 // Module additions 1288 $Manager->Execute('ALTER TABLE `Module` ADD `Version` VARCHAR(255) NOT NULL , '. 1289 'ADD `Creator` VARCHAR(255) NOT NULL , '. 1290 'ADD `License` VARCHAR(255) NOT NULL , '. 1291 'ADD `Installed` INT NOT NULL , '. 1292 'ADD `HomePage` VARCHAR(255) NOT NULL , '. 1293 'ADD `Description` TEXT NOT NULL ;'); 1294 1295 // ModuleLink 1296 $Manager->Execute('CREATE TABLE IF NOT EXISTS `ModuleLink` ( 1297 `Id` int(11) NOT NULL, 1298 `Module` int(11) NOT NULL, 1299 `LinkedModule` int(11) NOT NULL, 1300 `Type` int(11) NOT NULL 1301 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 1302 1303 $Manager->Execute('ALTER TABLE `ModuleLink` 1304 ADD PRIMARY KEY (`Id`), ADD KEY `Module` (`Module`), ADD KEY `LinkedModule` (`LinkedModule`);'); 1305 1306 $Manager->Execute('ALTER TABLE `ModuleLink` 1307 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;'); 1224 1308 } 1225 1309 … … 1287 1371 726 => array('Revision' => 729, 'Function' => 'UpdateTo729'), 1288 1372 729 => array('Revision' => 730, 'Function' => 'UpdateTo730'), 1373 730 => array('Revision' => 731, 'Function' => 'UpdateTo731'), 1289 1374 )); 1290 1375 }
Note:
See TracChangeset
for help on using the changeset viewer.