Ignore:
Timestamp:
Feb 16, 2013, 10:20:41 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení statistiky dokončení.
  • Opraveno: V aktualizaci databáze před nastavením cizích klíčů se musí smazat neplatné vazby.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/UpdateTrace.php

    r510 r516  
    23792379    $Manager->Execute('UPDATE `'.$Group['TablePrefix'].'` SET `Take` = NULL WHERE `Take` =0;');
    23802380    $Manager->Execute('ALTER TABLE `'.$Group['TablePrefix'].'` CHANGE `ID` `ID` INT( 11 ) NOT NULL AUTO_INCREMENT; ');
     2381    $Manager->Execute('UPDATE `'.$Group['TablePrefix'].'` SET `Take` = NULL WHERE NOT EXISTS (SELECT `Id` FROM ('.
     2382        'SELECT `Id` FROM `'.$Group['TablePrefix'].'` ) AS `T` WHERE `T`.`Id` = `'.$Group['TablePrefix'].
     2383        '`.`Take` ) AND `Take` IS NOT NULL');
    23812384    $Manager->Execute('ALTER TABLE `'.$Group['TablePrefix'].'` ADD FOREIGN KEY ( `Take` ) REFERENCES `'.$Group['TablePrefix'].'` ('.
    23822385      '`ID`) ON DELETE RESTRICT ON UPDATE RESTRICT ;');
Note: See TracChangeset for help on using the changeset viewer.