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('googlebase/types')};
00035 CREATE TABLE {$this->getTable('googlebase/types')} (
00036 `type_id` int(10) unsigned not null auto_increment ,
00037 `attribute_set_id` smallint(5) unsigned not null ,
00038 `gbase_itemtype` varchar(255) not null ,
00039 PRIMARY KEY (`type_id`),
00040 CONSTRAINT `GOOGLEBASE_TYPES_ATTRIBUTE_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `{$this->getTable('eav/attribute_set')}` (`attribute_set_id`) ON DELETE CASCADE
00041 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Item Types link Attribute Sets';
00042
00043 -- DROP TABLE IF EXISTS {$this->getTable('googlebase/items')};
00044 CREATE TABLE {$this->getTable('googlebase/items')} (
00045 `item_id` int(10) unsigned not null auto_increment ,
00046 `type_id` int(10) unsigned not null default '0',
00047 `product_id` int(10) unsigned not null ,
00048 `gbase_item_id` varchar(255) not null ,
00049 `store_id` smallint(5) unsigned not null ,
00050 `published` datetime NOT NULL default '0000-00-00 00:00:00',
00051 `expires` datetime NOT NULL default '0000-00-00 00:00:00',
00052 `impr` smallint(5) unsigned not null default '0',
00053 `clicks` smallint(5) unsigned not null default '0',
00054 `views` smallint(5) unsigned not null default '0',
00055 `is_hidden` tinyint not null default '0',
00056 PRIMARY KEY (`item_id`),
00057 CONSTRAINT `GOOGLEBASE_ITEMS_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE,
00058 CONSTRAINT `GOOGLEBASE_ITEMS_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON DELETE CASCADE
00059 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Items Products';
00060
00061 -- DROP TABLE IF EXISTS {$this->getTable('googlebase/attributes')};
00062 CREATE TABLE {$this->getTable('googlebase/attributes')} (
00063 `id` int(10) unsigned not null auto_increment ,
00064 `attribute_id` smallint(5) unsigned not null ,
00065 `gbase_attribute` varchar(255) not null ,
00066 `type_id` int(10) unsigned not null ,
00067 PRIMARY KEY (`id`),
00068 CONSTRAINT `GOOGLEBASE_ATTRIBUTES_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE,
00069 CONSTRAINT `GOOGLEBASE_ATTRIBUTES_TYPE_ID` FOREIGN KEY (`type_id`) REFERENCES `{$this->getTable('googlebase/types')}` (`type_id`) ON DELETE CASCADE
00070 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Attributes link Product Attributes';
00071
00072 ");
00073
00074 $installer->endSetup();