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 $installer = $this;
00027
00028
00029 $installer->startSetup();
00030 $installer->run("
00031 ALTER TABLE {$this->getTable('sales_order_entity')} MODIFY COLUMN `store_id` SMALLINT(5) UNSIGNED;
00032 ");
00033
00034 $installer->getConnection()->dropForeignKey($this->getTable('sales_order_entity'), 'FK_sales_order_entity_store');
00035 $installer->getConnection()->dropColumn($this->getTable('sales_order_entity_datetime'), 'store_id');
00036 $installer->getConnection()->dropColumn($this->getTable('sales_order_entity_decimal'), 'store_id');
00037 $installer->getConnection()->dropColumn($this->getTable('sales_order_entity_int'), 'store_id');
00038 $installer->getConnection()->dropColumn($this->getTable('sales_order_entity_text'), 'store_id');
00039 $installer->getConnection()->dropColumn($this->getTable('sales_order_entity_varchar'), 'store_id');
00040
00041 $installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_datetime'), 'store_id');
00042 $installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_decimal'), 'store_id');
00043 $installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_int'), 'store_id');
00044 $installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_text'), 'store_id');
00045 $installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_varchar'), 'store_id');
00046
00047 $installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_datetime'), 'store_id');
00048 $installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_decimal'), 'store_id');
00049 $installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_int'), 'store_id');
00050 $installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_text'), 'store_id');
00051 $installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_varchar'), 'store_id');
00052
00053 $installer->run("
00054 ALTER TABLE {$this->getTable('sales_order_entity')}
00055 ADD CONSTRAINT `FK_SALE_ORDER_ENTITY_STORE` FOREIGN KEY `FK_SALE_ORDER_ENTITY_STORE` (`store_id`)
00056 REFERENCES {$this->getTable('core_store')} (`store_id`)
00057 ON DELETE SET NULL
00058 ON UPDATE CASCADE;
00059 ");
00060 $installer->installEntities();
00061 $installer->endSetup();