Changeset 526 for trunk/admin/Updates.php
- Timestamp:
- Apr 21, 2013, 10:23:56 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/Updates.php
r517 r526 239 239 } 240 240 241 function UpdateTo526($Manager) 242 { 243 $Manager->Execute("ALTER TABLE `Hyperlink` CHANGE `Name` `Title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL"); 244 $Manager->Execute("ALTER TABLE `Hyperlink` ADD `Name` VARCHAR( 255 ) NOT NULL AFTER `Id`"); 245 //$Manager->Execute("ALTER TABLE `Hyperlink` ADD UNIQUE ( `Name` )"); 246 $Manager->Execute("ALTER TABLE `Hyperlink` ADD `Type` INT NOT NULL AFTER `Title` , ADD INDEX ( `Type` )"); 247 $Manager->Execute("RENAME TABLE `Hyperlink` TO `Action` ;"); 248 $Manager->Execute("RENAME TABLE `HyperlinkGroup` TO `ActionGroup` ;"); 249 $Manager->Execute("CREATE TABLE IF NOT EXISTS `ActionType` ( 250 `Id` int(11) NOT NULL AUTO_INCREMENT, 251 `Name` varchar(255) NOT NULL, 252 PRIMARY KEY (`Id`) 253 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; 254 255 INSERT INTO `ActionType` (`Id`, `Name`) VALUES 256 (1, 'Odkaz'), 257 (2, 'Obrázek');"); 258 $Manager->Execute("UPDATE `Action` SET `Type` = 1;"); 259 $Manager->Execute("ALTER TABLE `Action` ADD FOREIGN KEY ( `Type` ) REFERENCES `ActionType` (". 260 "`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 261 $Manager->Execute("UPDATE `Panel` SET `Module` = 'ActionGroup' WHERE `Module` = 'HyperlinkGroup'"); 262 $Manager->Execute("CREATE TABLE IF NOT EXISTS `ActionIcon` ( 263 `Id` int(11) NOT NULL AUTO_INCREMENT, 264 `Name` varchar(255) NOT NULL, 265 PRIMARY KEY (`Id`) 266 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 267 $Manager->Execute("INSERT INTO `ActionIcon` (SELECT NULL AS `Id`, `IconFile` AS `Name` FROM `Action` WHERE `IconFile` != '' GROUP BY `IconFile`)"); 268 $Manager->Execute("UPDATE `Action` SET `IconFile` = (SELECT `Id` FROM `ActionIcon` WHERE `ActionIcon`.`Name` = `Action`.`IconFile`) "); 269 $Manager->Execute("ALTER TABLE `Action` CHANGE `IconFile` `Icon` INT NULL "); 270 $Manager->Execute("UPDATE `Action` SET `Icon` = NULL WHERE `Icon` = 0"); 271 $Manager->Execute("ALTER TABLE `Action` ADD INDEX ( `Icon` ) "); 272 $Manager->Execute("ALTER TABLE `Action` ADD FOREIGN KEY ( `Icon` ) REFERENCES `ActionIcon` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 273 $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ". 274 "VALUES (NULL , 'Akce', '23', 'Action', '');"); 275 } 241 276 242 277 $Updates = array( … … 253 288 507 => array('Revision' => 515, 'Function' => 'UpdateTo515'), 254 289 515 => array('Revision' => 517, 'Function' => 'UpdateTo517'), 290 517 => array('Revision' => 526, 'Function' => 'UpdateTo526'), 255 291 ); 256 292
Note:
See TracChangeset
for help on using the changeset viewer.