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 DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_flat')}`;
00034 CREATE TABLE `{$installer->getTable('catalog/category_flat')}` (
00035 `entity_id` int(10) unsigned not null,
00036 `store_id` smallint(5) unsigned not null default '0',
00037 `parent_id` int(10) unsigned not null default '0',
00038 `path` varchar(255) not null default '',
00039 `level` int(11) not null default '0',
00040 `position` int(11) not null default '0',
00041 `children_count` int(11) not null,
00042 `created_at` datetime not null default '0000-00-00 00:00:00',
00043 `updated_at` datetime not null default '0000-00-00 00:00:00',
00044 KEY `CATEGORY_FLAT_CATEGORY_ID` (`entity_id`),
00045 KEY `CATEGORY_FLAT_STORE_ID` (`store_id`),
00046 KEY `path` (`path`),
00047 KEY `IDX_LEVEL` (`level`),
00048 CONSTRAINT `FK_CATEGORY_FLAT_CATEGORY_ID` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog/category')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00049 CONSTRAINT `FK_CATEGORY_FLAT_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
00050 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Flat Category'
00051 ");
00052
00053 $installer->endSetup();