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('sales_counter')}`;
00041 CREATE TABLE `{$installer->getTable('sales_counter')}` (
00042 `counter_id` int(10) unsigned NOT NULL auto_increment,
00043 `store_id` smallint(5) unsigned NOT NULL default '0',
00044 `counter_type` varchar(50) NOT NULL default '',
00045 `counter_value` varchar(50) NOT NULL default '',
00046 PRIMARY KEY (`counter_id`),
00047 UNIQUE KEY `store_id` (`store_id`,`counter_type`),
00048 CONSTRAINT `FK_SALES_COUNTER_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
00049 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00050
00051 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_discount_coupon')}`;
00052 CREATE TABLE `{$installer->getTable('sales_discount_coupon')}` (
00053 `coupon_id` int(10) unsigned NOT NULL auto_increment,
00054 `coupon_code` varchar(50) NOT NULL default '',
00055 `discount_percent` decimal(10,4) NOT NULL default '0.0000',
00056 `discount_fixed` decimal(10,4) NOT NULL default '0.0000',
00057 `is_active` tinyint(1) NOT NULL default '1',
00058 `from_date` datetime NOT NULL default '0000-00-00 00:00:00',
00059 `to_date` datetime NOT NULL default '0000-00-00 00:00:00',
00060 `min_subtotal` decimal(12,4) NOT NULL default '0.0000',
00061 `limit_products` text NOT NULL,
00062 `limit_categories` text NOT NULL,
00063 `limit_attributes` text NOT NULL,
00064 PRIMARY KEY (`coupon_id`)
00065 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00066
00067 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_giftcert')}`;
00068 CREATE TABLE `{$installer->getTable('sales_giftcert')}` (
00069 `giftcert_id` int(10) unsigned NOT NULL auto_increment,
00070 `giftcert_code` varchar(50) NOT NULL default '',
00071 `balance_amount` decimal(12,4) NOT NULL default '0.0000',
00072 PRIMARY KEY (`giftcert_id`),
00073 UNIQUE KEY `gift_code` (`giftcert_code`)
00074 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00075
00076 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity')}`;
00077 CREATE TABLE `{$installer->getTable('sales_order_entity')}` (
00078 `entity_id` int(10) unsigned NOT NULL auto_increment,
00079 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00080 `attribute_set_id` smallint(5) unsigned NOT NULL default '0',
00081 `increment_id` varchar(50) NOT NULL default '',
00082 `parent_id` int(10) unsigned NOT NULL default '0',
00083 `store_id` smallint(5) unsigned default NULL,
00084 `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
00085 `updated_at` datetime NOT NULL default '0000-00-00 00:00:00',
00086 `is_active` tinyint(1) unsigned NOT NULL default '1',
00087 PRIMARY KEY (`entity_id`),
00088 KEY `FK_sales_order_entity_type` (`entity_type_id`),
00089 KEY `FK_sales_order_entity_store` (`store_id`),
00090 CONSTRAINT `FK_SALE_ORDER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
00091 CONSTRAINT `FK_sales_order_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00092 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
00093
00094 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_datetime')}`;
00095 CREATE TABLE `{$installer->getTable('sales_order_entity_datetime')}` (
00096 `value_id` int(11) NOT NULL auto_increment,
00097 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00098 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00099 `entity_id` int(10) unsigned NOT NULL default '0',
00100 `value` datetime NOT NULL default '0000-00-00 00:00:00',
00101 PRIMARY KEY (`value_id`),
00102 KEY `FK_sales_order_entity_datetime_entity_type` (`entity_type_id`),
00103 KEY `FK_sales_order_entity_datetime_attribute` (`attribute_id`),
00104 KEY `FK_sales_order_entity_datetime` (`entity_id`),
00105 CONSTRAINT `FK_sales_order_entity_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00106 CONSTRAINT `FK_sales_order_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00107 CONSTRAINT `FK_sales_order_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00108 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00109
00110 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_decimal')}`;
00111 CREATE TABLE `{$installer->getTable('sales_order_entity_decimal')}` (
00112 `value_id` int(11) NOT NULL auto_increment,
00113 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00114 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00115 `entity_id` int(10) unsigned NOT NULL default '0',
00116 `value` decimal(12,4) NOT NULL default '0.0000',
00117 PRIMARY KEY (`value_id`),
00118 KEY `FK_sales_order_entity_decimal_entity_type` (`entity_type_id`),
00119 KEY `FK_sales_order_entity_decimal_attribute` (`attribute_id`),
00120 KEY `FK_sales_order_entity_decimal` (`entity_id`),
00121 CONSTRAINT `FK_sales_order_entity_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00122 CONSTRAINT `FK_sales_order_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00123 CONSTRAINT `FK_sales_order_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00124 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00125
00126 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_int')}`;
00127 CREATE TABLE `{$installer->getTable('sales_order_entity_int')}` (
00128 `value_id` int(11) NOT NULL auto_increment,
00129 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00130 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00131 `entity_id` int(10) unsigned NOT NULL default '0',
00132 `value` int(11) NOT NULL default '0',
00133 PRIMARY KEY (`value_id`),
00134 KEY `FK_sales_order_entity_int_entity_type` (`entity_type_id`),
00135 KEY `FK_sales_order_entity_int_attribute` (`attribute_id`),
00136 KEY `FK_sales_order_entity_int` (`entity_id`),
00137 CONSTRAINT `FK_sales_order_entity_int` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00138 CONSTRAINT `FK_sales_order_entity_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00139 CONSTRAINT `FK_sales_order_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00140 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00141
00142 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_text')}`;
00143 CREATE TABLE `{$installer->getTable('sales_order_entity_text')}` (
00144 `value_id` int(11) NOT NULL auto_increment,
00145 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00146 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00147 `entity_id` int(10) unsigned NOT NULL default '0',
00148 `value` text NOT NULL,
00149 PRIMARY KEY (`value_id`),
00150 KEY `FK_sales_order_entity_text_entity_type` (`entity_type_id`),
00151 KEY `FK_sales_order_entity_text_attribute` (`attribute_id`),
00152 KEY `FK_sales_order_entity_text` (`entity_id`),
00153 CONSTRAINT `FK_sales_order_entity_text` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00154 CONSTRAINT `FK_sales_order_entity_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00155 CONSTRAINT `FK_sales_order_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00156 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00157
00158 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_varchar')}`;
00159 CREATE TABLE `{$installer->getTable('sales_order_entity_varchar')}` (
00160 `value_id` int(11) NOT NULL auto_increment,
00161 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00162 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00163 `entity_id` int(10) unsigned NOT NULL default '0',
00164 `value` varchar(255) NOT NULL default '',
00165 PRIMARY KEY (`value_id`),
00166 KEY `FK_sales_order_entity_varchar_entity_type` (`entity_type_id`),
00167 KEY `FK_sales_order_entity_varchar_attribute` (`attribute_id`),
00168 KEY `FK_sales_order_entity_varchar` (`entity_id`),
00169 CONSTRAINT `FK_sales_order_entity_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00170 CONSTRAINT `FK_sales_order_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00171 CONSTRAINT `FK_sales_order_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00172 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00173
00174 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity')}`;
00175 CREATE TABLE `{$installer->getTable('sales_quote_entity')}` (
00176 `entity_id` int(10) unsigned NOT NULL auto_increment,
00177 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00178 `attribute_set_id` smallint(5) unsigned NOT NULL default '0',
00179 `increment_id` varchar(50) NOT NULL default '',
00180 `parent_id` int(10) unsigned NOT NULL default '0',
00181 `store_id` smallint(5) unsigned NOT NULL default '0',
00182 `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
00183 `updated_at` datetime NOT NULL default '0000-00-00 00:00:00',
00184 `is_active` tinyint(1) unsigned NOT NULL default '1',
00185 PRIMARY KEY (`entity_id`),
00186 KEY `FK_sales_quote_entity_type` (`entity_type_id`),
00187 KEY `FK_sales_quote_entity_store` (`store_id`),
00188 CONSTRAINT `FK_sales_quote_entity_store` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00189 CONSTRAINT `FK_sales_quote_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00190 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
00191
00192 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_datetime')}`;
00193 CREATE TABLE `{$installer->getTable('sales_quote_entity_datetime')}` (
00194 `value_id` int(11) NOT NULL auto_increment,
00195 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00196 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00197 `entity_id` int(10) unsigned NOT NULL default '0',
00198 `value` datetime NOT NULL default '0000-00-00 00:00:00',
00199 PRIMARY KEY (`value_id`),
00200 KEY `FK_sales_quote_entity_datetime_entity_type` (`entity_type_id`),
00201 KEY `FK_sales_quote_entity_datetime_attribute` (`attribute_id`),
00202 KEY `FK_sales_quote_entity_datetime` (`entity_id`),
00203 CONSTRAINT `FK_sales_quote_entity_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00204 CONSTRAINT `FK_sales_quote_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00205 CONSTRAINT `FK_sales_quote_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00206 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00207
00208 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_decimal')}`;
00209 CREATE TABLE `{$installer->getTable('sales_quote_entity_decimal')}` (
00210 `value_id` int(11) NOT NULL auto_increment,
00211 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00212 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00213 `entity_id` int(10) unsigned NOT NULL default '0',
00214 `value` decimal(12,4) NOT NULL default '0.0000',
00215 PRIMARY KEY (`value_id`),
00216 KEY `FK_sales_quote_entity_decimal_entity_type` (`entity_type_id`),
00217 KEY `FK_sales_quote_entity_decimal_attribute` (`attribute_id`),
00218 KEY `FK_sales_quote_entity_decimal` (`entity_id`),
00219 CONSTRAINT `FK_sales_quote_entity_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00220 CONSTRAINT `FK_sales_quote_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00221 CONSTRAINT `FK_sales_quote_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00222 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00223
00224 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_int')}`;
00225 CREATE TABLE `{$installer->getTable('sales_quote_entity_int')}` (
00226 `value_id` int(11) NOT NULL auto_increment,
00227 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00228 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00229 `entity_id` int(10) unsigned NOT NULL default '0',
00230 `value` int(11) NOT NULL default '0',
00231 PRIMARY KEY (`value_id`),
00232 KEY `FK_sales_quote_entity_int_entity_type` (`entity_type_id`),
00233 KEY `FK_sales_quote_entity_int_attribute` (`attribute_id`),
00234 KEY `FK_sales_quote_entity_int` (`entity_id`),
00235 CONSTRAINT `FK_sales_quote_entity_int` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00236 CONSTRAINT `FK_sales_quote_entity_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00237 CONSTRAINT `FK_sales_quote_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00238 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00239
00240 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_text')}`;
00241 CREATE TABLE `{$installer->getTable('sales_quote_entity_text')}` (
00242 `value_id` int(11) NOT NULL auto_increment,
00243 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00244 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00245 `entity_id` int(10) unsigned NOT NULL default '0',
00246 `value` text NOT NULL,
00247 PRIMARY KEY (`value_id`),
00248 KEY `FK_sales_quote_entity_text_entity_type` (`entity_type_id`),
00249 KEY `FK_sales_quote_entity_text_attribute` (`attribute_id`),
00250 KEY `FK_sales_quote_entity_text` (`entity_id`),
00251 CONSTRAINT `FK_sales_quote_entity_text` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00252 CONSTRAINT `FK_sales_quote_entity_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00253 CONSTRAINT `FK_sales_quote_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00254 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00255
00256 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_varchar')}`;
00257 CREATE TABLE `{$installer->getTable('sales_quote_entity_varchar')}` (
00258 `value_id` int(11) NOT NULL auto_increment,
00259 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00260 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00261 `entity_id` int(10) unsigned NOT NULL default '0',
00262 `value` varchar(255) NOT NULL default '',
00263 PRIMARY KEY (`value_id`),
00264 KEY `FK_sales_quote_entity_varchar_entity_type` (`entity_type_id`),
00265 KEY `FK_sales_quote_entity_varchar_attribute` (`attribute_id`),
00266 KEY `FK_sales_quote_entity_varchar` (`entity_id`),
00267 CONSTRAINT `FK_sales_quote_entity_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00268 CONSTRAINT `FK_sales_quote_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00269 CONSTRAINT `FK_sales_quote_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00270 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00271
00272 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_rule')}`;
00273 CREATE TABLE `{$installer->getTable('sales_quote_rule')}` (
00274 `quote_rule_id` int(10) unsigned NOT NULL auto_increment,
00275 `name` varchar(255) NOT NULL default '',
00276 `description` text NOT NULL,
00277 `is_active` tinyint(4) NOT NULL default '0',
00278 `start_at` datetime NOT NULL default '0000-00-00 00:00:00',
00279 `expire_at` datetime NOT NULL default '0000-00-00 00:00:00',
00280 `coupon_code` varchar(50) NOT NULL default '',
00281 `customer_registered` tinyint(1) NOT NULL default '2',
00282 `customer_new_buyer` tinyint(1) NOT NULL default '2',
00283 `show_in_catalog` tinyint(1) NOT NULL default '0',
00284 `sort_order` smallint(6) NOT NULL default '0',
00285 `conditions_serialized` text NOT NULL,
00286 `actions_serialized` text NOT NULL,
00287 PRIMARY KEY (`quote_rule_id`),
00288 KEY `rule_name` (`name`),
00289 KEY `is_active` (`is_active`,`start_at`,`expire_at`,`coupon_code`,`customer_registered`,`customer_new_buyer`,`show_in_catalog`,`sort_order`)
00290 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00291
00292 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp')}`;
00293 CREATE TABLE `{$installer->getTable('sales_quote_temp')}` (
00294 `entity_id` int(10) unsigned NOT NULL auto_increment,
00295 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00296 `attribute_set_id` smallint(5) unsigned NOT NULL default '0',
00297 `increment_id` varchar(50) NOT NULL default '',
00298 `parent_id` int(10) unsigned NOT NULL default '0',
00299 `store_id` smallint(5) unsigned NOT NULL default '0',
00300 `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
00301 `updated_at` datetime NOT NULL default '0000-00-00 00:00:00',
00302 `is_active` tinyint(1) unsigned NOT NULL default '1',
00303 PRIMARY KEY (`entity_id`),
00304 KEY `FK_sales_quote_temp_type` (`entity_type_id`),
00305 KEY `FK_sales_quote_temp_store` (`store_id`),
00306 CONSTRAINT `FK_sales_quote_temp_store` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00307 CONSTRAINT `FK_sales_quote_temp_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00308 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
00309
00310 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_datetime')}`;
00311 CREATE TABLE `{$installer->getTable('sales_quote_temp_datetime')}` (
00312 `value_id` int(11) NOT NULL auto_increment,
00313 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00314 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00315 `entity_id` int(10) unsigned NOT NULL default '0',
00316 `value` datetime NOT NULL default '0000-00-00 00:00:00',
00317 PRIMARY KEY (`value_id`),
00318 KEY `FK_sales_quote_temp_datetime_entity_type` (`entity_type_id`),
00319 KEY `FK_sales_quote_temp_datetime_attribute` (`attribute_id`),
00320 KEY `FK_sales_quote_temp_datetime` (`entity_id`),
00321 CONSTRAINT `FK_sales_quote_temp_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00322 CONSTRAINT `FK_sales_quote_temp_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00323 CONSTRAINT `FK_sales_quote_temp_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00324 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00325
00326 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_decimal')}`;
00327 CREATE TABLE `{$installer->getTable('sales_quote_temp_decimal')}` (
00328 `value_id` int(11) NOT NULL auto_increment,
00329 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00330 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00331 `entity_id` int(10) unsigned NOT NULL default '0',
00332 `value` decimal(12,4) NOT NULL default '0.0000',
00333 PRIMARY KEY (`value_id`),
00334 KEY `FK_sales_quote_temp_decimal_entity_type` (`entity_type_id`),
00335 KEY `FK_sales_quote_temp_decimal_attribute` (`attribute_id`),
00336 KEY `FK_sales_quote_temp_decimal` (`entity_id`),
00337 CONSTRAINT `FK_sales_quote_temp_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00338 CONSTRAINT `FK_sales_quote_temp_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00339 CONSTRAINT `FK_sales_quote_temp_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00340 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00341
00342 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_int')}`;
00343 CREATE TABLE `{$installer->getTable('sales_quote_temp_int')}` (
00344 `value_id` int(11) NOT NULL auto_increment,
00345 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00346 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00347 `entity_id` int(10) unsigned NOT NULL default '0',
00348 `value` int(11) NOT NULL default '0',
00349 PRIMARY KEY (`value_id`),
00350 KEY `FK_sales_quote_temp_int_entity_type` (`entity_type_id`),
00351 KEY `FK_sales_quote_temp_int_attribute` (`attribute_id`),
00352 KEY `FK_sales_quote_temp_int` (`entity_id`),
00353 CONSTRAINT `FK_sales_quote_temp_int` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00354 CONSTRAINT `FK_sales_quote_temp_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00355 CONSTRAINT `FK_sales_quote_temp_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00356 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00357
00358 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_text')}`;
00359 CREATE TABLE `{$installer->getTable('sales_quote_temp_text')}` (
00360 `value_id` int(11) NOT NULL auto_increment,
00361 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00362 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00363 `entity_id` int(10) unsigned NOT NULL default '0',
00364 `value` text NOT NULL,
00365 PRIMARY KEY (`value_id`),
00366 KEY `FK_sales_quote_temp_text_entity_type` (`entity_type_id`),
00367 KEY `FK_sales_quote_temp_text_attribute` (`attribute_id`),
00368 KEY `FK_sales_quote_temp_text` (`entity_id`),
00369 CONSTRAINT `FK_sales_quote_temp_text` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00370 CONSTRAINT `FK_sales_quote_temp_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00371 CONSTRAINT `FK_sales_quote_temp_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00372 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00373
00374 -- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_varchar')}`;
00375 CREATE TABLE `{$installer->getTable('sales_quote_temp_varchar')}` (
00376 `value_id` int(11) NOT NULL auto_increment,
00377 `entity_type_id` smallint(8) unsigned NOT NULL default '0',
00378 `attribute_id` smallint(5) unsigned NOT NULL default '0',
00379 `entity_id` int(10) unsigned NOT NULL default '0',
00380 `value` varchar(255) NOT NULL default '',
00381 PRIMARY KEY (`value_id`),
00382 KEY `FK_sales_quote_temp_varchar_entity_type` (`entity_type_id`),
00383 KEY `FK_sales_quote_temp_varchar_attribute` (`attribute_id`),
00384 KEY `FK_sales_quote_temp_varchar` (`entity_id`),
00385 CONSTRAINT `FK_sales_quote_temp_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00386 CONSTRAINT `FK_sales_quote_temp_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00387 CONSTRAINT `FK_sales_quote_temp_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
00388 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00389 ");
00390 $installer->endSetup();
00391
00392 $installer->installEntities();