Changeset 401 for branches/Modular/Common/Model.php
- Timestamp:
- Mar 30, 2012, 2:02:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Modular/Common/Model.php
r398 r401 236 236 $this->Module->Models[$Property['TargetModel']]->Install(); 237 237 } 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`);'); 239 240 } 240 } 241 } 241 } } 242 242 243 243 function UnInstall() … … 247 247 if($Property['Type'] == PropertyManyToMany) 248 248 ; // 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 } 249 255 } 250 $this->Database->query('DROP TABLE IF EXISTS `'.$this->Name.'`');256 //$this->Database->query('DROP TABLE IF EXISTS `'.$this->Name.'`'); 251 257 $this->Installed = false; 252 258 }
Note:
See TracChangeset
for help on using the changeset viewer.