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
00034 DROP TABLE IF EXISTS `{$this->getTable('cms/page_store')}`;
00035 CREATE TABLE `{$this->getTable('cms/page_store')}` (
00036 `page_id` smallint(6) NOT NULL,
00037 `store_id` smallint(5) unsigned NOT NULL,
00038 PRIMARY KEY (`page_id`,`store_id`),
00039 CONSTRAINT `FK_CMS_PAGE_STORE_PAGE` FOREIGN KEY (`page_id`) REFERENCES `{$this->getTable('cms/page')}` (`page_id`) ON UPDATE CASCADE ON DELETE CASCADE,
00040 CONSTRAINT `FK_CMS_PAGE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
00041 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CMS Pages to Stores';
00042
00043 INSERT INTO {$this->getTable('cms/page_store')} (`page_id`, `store_id`) SELECT `page_id`, `store_id` FROM {$this->getTable('cms/page')};
00044
00045 DROP TABLE IF EXISTS {$this->getTable('cms/block_store')};
00046 CREATE TABLE {$this->getTable('cms/block_store')} (
00047 `block_id` smallint(6) NOT NULL,
00048 `store_id` smallint(5) unsigned NOT NULL,
00049 PRIMARY KEY (`block_id`,`store_id`),
00050 CONSTRAINT `FK_CMS_BLOCK_STORE_BLOCK` FOREIGN KEY (`block_id`) REFERENCES {$this->getTable('cms/block')} (`block_id`) ON UPDATE CASCADE ON DELETE CASCADE,
00051 CONSTRAINT `FK_CMS_BLOCK_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core/store')} (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
00052 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CMS Blocks to Stores';
00053
00054 INSERT INTO {$this->getTable('cms/block_store')} (`block_id`, `store_id`) SELECT `block_id`, `store_id` FROM {$this->getTable('cms/block')};
00055
00056 ");
00057
00058 $installer->endSetup();