Ignore:
Timestamp:
Mar 1, 2013, 11:02:44 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Pozice subjektu na mapě se nyní zadává jako odkaz do tabulky MapPosition.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/Updates.php

    r494 r495  
    1313}
    1414
    15 
     15function 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}
    1625
    1726$Updates = array(
    1827        491 => array('Revision' => 493, 'Function' => 'UpdateTo493'),
    1928  493 => array('Revision' => 494, 'Function' => 'UpdateTo494'),
     29  494 => array('Revision' => 495, 'Function' => 'UpdateTo495'),
    2030);
    2131
Note: See TracChangeset for help on using the changeset viewer.