*/ $installer = $this; /* @var $installer Mage_Core_Model_Resource_Setup */ $installer->startSetup(); $installer->run(" ALTER TABLE {$this->getTable('newsletter_queue_store_link')} ADD CONSTRAINT `FK_NEWSLETTER_QUEUE_STORE_LINK_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE; "); $installer->run(" ALTER TABLE {$this->getTable('newsletter_subscriber')} DROP INDEX `FK_SUBSCRIBER_STORE`; ALTER TABLE {$this->getTable('newsletter_subscriber')} CHANGE `store_id` `store_id` smallint(5) unsigned NULL DEFAULT '0'; ALTER TABLE {$this->getTable('newsletter_subscriber')} ADD CONSTRAINT `FK_NEWSLETTER_SUBSCRIBER_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON UPDATE CASCADE ON DELETE SET NULL; "); $installer->endSetup();