00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 $installer = $this;
00028
00029
00030 $installer->startSetup();
00031
00032 $installer->run("
00033 ALTER TABLE {$this->getTable('catalog_product_bundle_option')}
00034 ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT` FOREIGN KEY (`parent_id`)
00035 REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`)
00036 ON DELETE CASCADE
00037 ON UPDATE CASCADE;
00038 ALTER TABLE {$this->getTable('catalog_product_bundle_option_value')}
00039 ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`)
00040 REFERENCES {$this->getTable('catalog_product_bundle_option')} (`option_id`)
00041 ON DELETE CASCADE
00042 ON UPDATE CASCADE;
00043 ALTER TABLE {$this->getTable('catalog_product_bundle_selection')}
00044 ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION` FOREIGN KEY (`option_id`)
00045 REFERENCES {$this->getTable('catalog_product_bundle_option')} (`option_id`)
00046 ON DELETE CASCADE
00047 ON UPDATE CASCADE,
00048 ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT` FOREIGN KEY (`product_id`)
00049 REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`)
00050 ON DELETE CASCADE
00051 ON UPDATE CASCADE;
00052 ");
00053
00054 $installer->endSetup();