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
00040 $this->getConnection()->dropColumn($this->getTable('customer_address_entity'), 'store_id');
00041
00042 $installer->run("
00043 ALTER TABLE {$this->getTable('customer_entity')}
00044 DROP INDEX `FK_CUSTOMER_ENTITY_STORE`;
00045 ALTER TABLE {$this->getTable('customer_entity')}
00046 CHANGE `store_id` `store_id` smallint(5) unsigned NULL DEFAULT '0';
00047 ALTER TABLE {$this->getTable('customer_entity')}
00048 ADD CONSTRAINT `FK_CUSTOMER_ENTITY_STORE` FOREIGN KEY (`store_id`)
00049 REFERENCES {$this->getTable('core_store')} (`store_id`)
00050 ON UPDATE CASCADE
00051 ON DELETE SET NULL;
00052 ");
00053 $installer->run("
00054 ALTER TABLE {$this->getTable('customer_entity')}
00055 DROP INDEX `FK_CUSTOMER_ENTITY_ENTITY_TYPE`,
00056 ADD INDEX `IDX_ENTITY_TYPE` (`entity_type_id`);
00057 ");
00058 $installer->run("
00059 ALTER TABLE {$this->getTable('customer_entity')}
00060 DROP INDEX `FK_CUSTOMER_ENTITY_PARENT_ENTITY`,
00061 ADD INDEX `IDX_PARENT_ENTITY` (`parent_id`);
00062 ");
00063
00064 $this->getConnection()->dropColumn($this->getTable('customer_entity_varchar'), 'store_id');
00065 $this->getConnection()->dropColumn($this->getTable('customer_entity_text'), 'store_id');
00066 $this->getConnection()->dropColumn($this->getTable('customer_entity_int'), 'store_id');
00067 $this->getConnection()->dropColumn($this->getTable('customer_entity_decimal'), 'store_id');
00068 $this->getConnection()->dropColumn($this->getTable('customer_entity_datetime'), 'store_id');
00069
00070 $this->getConnection()->dropColumn($this->getTable('customer_address_entity_varchar'), 'store_id');
00071 $this->getConnection()->dropColumn($this->getTable('customer_address_entity_text'), 'store_id');
00072 $this->getConnection()->dropColumn($this->getTable('customer_address_entity_int'), 'store_id');
00073 $this->getConnection()->dropColumn($this->getTable('customer_address_entity_decimal'), 'store_id');
00074 $this->getConnection()->dropColumn($this->getTable('customer_address_entity_datetime'), 'store_id');
00075
00076 $installer->endSetup();