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 $installer->run("
00040 -- DROP TABLE IF EXISTS `{$installer->getTable('product_alert_price')}`;
00041 CREATE TABLE IF NOT EXISTS `{$installer->getTable('product_alert_price')}` (
00042 `alert_price_id` int(10) unsigned NOT NULL auto_increment,
00043 `customer_id` int(10) unsigned NOT NULL default '0',
00044 `product_id` int(10) unsigned NOT NULL default '0',
00045 `price` decimal(12,4) NOT NULL default '0',
00046 `website_id` smallint(5) unsigned NOT NULL default '0',
00047 `add_date` datetime NOT NULL default '0000-00-00 00:00:00',
00048 `last_send_date` datetime default NULL,
00049 `send_count` smallint(5) unsigned NOT NULL default '0',
00050 `status` tinyint(3) unsigned NOT NULL default '0',
00051 PRIMARY KEY (`alert_price_id`),
00052 CONSTRAINT `FK_PRODUCT_ALERT_PRICE_CUSTOMER`
00053 FOREIGN KEY (`customer_id`)
00054 REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`)
00055 ON DELETE CASCADE
00056 ON UPDATE CASCADE,
00057 CONSTRAINT `FK_PRODUCT_ALERT_PRICE_PRODUCT`
00058 FOREIGN KEY (`product_id`)
00059 REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`)
00060 ON DELETE CASCADE
00061 ON UPDATE CASCADE,
00062 CONSTRAINT `FK_PRODUCT_ALERT_PRICE_WEBSITE`
00063 FOREIGN KEY (`website_id`)
00064 REFERENCES `{$installer->getTable('core_website')}` (`website_id`)
00065 ON DELETE CASCADE
00066 ON UPDATE CASCADE
00067 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00068
00069 -- DROP TABLE IF EXISTS `{$installer->getTable('product_alert_stock')}`;
00070 CREATE TABLE `{$installer->getTable('product_alert_stock')}` (
00071 `alert_stock_id` int(10) unsigned NOT NULL auto_increment,
00072 `customer_id` int(10) unsigned NOT NULL default '0',
00073 `product_id` int(10) unsigned NOT NULL default '0',
00074 `website_id` smallint(5) unsigned NOT NULL default '0',
00075 `add_date` datetime NOT NULL default '0000-00-00 00:00:00',
00076 `send_date` datetime default NULL,
00077 `send_count` smallint(5) unsigned NOT NULL default '0',
00078 `status` tinyint(3) unsigned NOT NULL default '0',
00079 PRIMARY KEY (`alert_stock_id`),
00080 CONSTRAINT `FK_PRODUCT_ALERT_STOCK_CUSTOMER`
00081 FOREIGN KEY (`customer_id`)
00082 REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`)
00083 ON DELETE CASCADE
00084 ON UPDATE CASCADE,
00085 CONSTRAINT `FK_PRODUCT_ALERT_STOCK_PRODUCT`
00086 FOREIGN KEY (`product_id`)
00087 REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`)
00088 ON DELETE CASCADE
00089 ON UPDATE CASCADE,
00090 CONSTRAINT `FK_PRODUCT_ALERT_STOCK_WEBSITE`
00091 FOREIGN KEY (`website_id`)
00092 REFERENCES `{$installer->getTable('core_website')}` (`website_id`)
00093 ON DELETE CASCADE
00094 ON UPDATE CASCADE
00095 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00096 ");
00097 $installer->endSetup();