Ignore:
Timestamp:
Mar 30, 2012, 2:02:51 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Instalace a odinstalace je nyní spravována samostatným skriptem install.php.
  • Upraveno: Částečné řešení odstranění cizích klíčů v průběhu odinstalace před odstraněním samotných tabulek.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Modular/Common/Model.php

    r398 r401  
    236236            $this->Module->Models[$Property['TargetModel']]->Install();
    237237        }
    238         $this->Database->query('ALTER TABLE `'.$this->Name.'` ADD FOREIGN KEY (`'.$Property['Name'].'`) REFERENCES `'.$Property['TargetModel'].'` (`Id`);');
     238        $this->Database->query('ALTER TABLE `'.$this->Name.'` ADD CONSTRAINT `'.
     239          $this->Name.'_ibfk_'.$Property['Name'].'` FOREIGN KEY (`'.$Property['Name'].'`) REFERENCES `'.$Property['TargetModel'].'` (`Id`);');
    239240      }
    240     }
    241   }
     241    }  }
    242242   
    243243  function UnInstall()
     
    247247      if($Property['Type'] == PropertyManyToMany)
    248248        ; // Delete many-to-many table
     249      else
     250      {if($Property['Type'] == PropertyOneToMany)
     251        $this->Database->query('ALTER TABLE `'.$this->Name.'` DROP FOREIGN KEY `'.
     252          $this->Name.'_ibfk_'.$Property['Name'].'`');
     253      echo('ss');
     254      }
    249255    }
    250     $this->Database->query('DROP TABLE IF EXISTS `'.$this->Name.'`');
     256    //$this->Database->query('DROP TABLE IF EXISTS `'.$this->Name.'`');
    251257    $this->Installed = false;
    252258  }
Note: See TracChangeset for help on using the changeset viewer.