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
00028
00029
00030
00031
00032
00033
00034
00035 $installer = $this;
00036
00037
00038 $installer->startSetup();
00039
00040 $installer->run("
00041 ALTER TABLE {$this->getTable('poll_store')}
00042 DROP FOREIGN KEY `FK_POLL_STORE`;
00043 ALTER TABLE {$this->getTable('poll_store')}
00044 ADD CONSTRAINT `FK_POLL_STORE_POLL` FOREIGN KEY (`poll_id`)
00045 REFERENCES {$this->getTable('poll')} (`poll_id`)
00046 ON UPDATE CASCADE
00047 ON DELETE CASCADE;
00048 ");
00049 $installer->run("
00050 ALTER TABLE {$this->getTable('poll')}
00051 CHANGE `store_id` `store_id` smallint(5) unsigned NULL DEFAULT '0';
00052 ALTER TABLE {$this->getTable('poll')}
00053 ADD CONSTRAINT `FK_POLL_STORE` FOREIGN KEY (`store_id`)
00054 REFERENCES {$this->getTable('core_store')} (`store_id`)
00055 ON UPDATE CASCADE
00056 ON DELETE SET NULL;
00057 ");
00058 $installer->run("
00059 ALTER TABLE {$this->getTable('poll_store')}
00060 ADD CONSTRAINT `FK_POLL_STORE_STORE` FOREIGN KEY (`store_id`)
00061 REFERENCES {$this->getTable('core_store')} (`store_id`)
00062 ON UPDATE CASCADE
00063 ON DELETE CASCADE;
00064 ");
00065 $installer->endSetup();