Changeset 495 for trunk/admin/Updates.php
- Timestamp:
- Mar 1, 2013, 11:02:44 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/Updates.php
r494 r495 13 13 } 14 14 15 15 function UpdateTo495($Manager) 16 { 17 $Manager->Execute("INSERT INTO `MapPosition` (SELECT NULL AS `Id`, `Name`, `MapPositionX` AS `Latitude`, `MapPositionY` AS `Longitude` FROM `Subject`)"); 18 $Manager->Execute("ALTER TABLE `Subject` ADD `MapPosition` INT NULL AFTER `PayVAT`"); 19 $Manager->Execute("UPDATE `Subject` SET `MapPosition` = (SELECT `MapPosition`.`Id` FROM `MapPosition` WHERE `MapPosition`.`Name` = `Subject`.`Name` LIMIT 1)"); 20 $Manager->Execute("ALTER TABLE `Subject` DROP `MapPositionX`, DROP `MapPositionY`;"); 21 $Manager->Execute("ALTER TABLE `Subject` ADD INDEX ( `MapPosition` ) "); 22 $Manager->Execute("ALTER TABLE `Subject` ADD FOREIGN KEY ( `MapPosition` ) REFERENCES `MapPosition` (". 23 "`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 24 } 16 25 17 26 $Updates = array( 18 27 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), 19 28 493 => array('Revision' => 494, 'Function' => 'UpdateTo494'), 29 494 => array('Revision' => 495, 'Function' => 'UpdateTo495'), 20 30 ); 21 31
Note:
See TracChangeset
for help on using the changeset viewer.