Created
February 8, 2016 14:36
-
-
Save claudiu-marginean/c8a2d1970246e590ee0f to your computer and use it in GitHub Desktop.
Magento Change EAV Attribute type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Change EAV Attribute Type from dropdown to multipleselect | |
# - copy old attribute values to new table | |
# | |
dropdown attribute_id = 137 | |
UPDATE eav_attribute SET | |
backend_model = 'eav/entity_attribute_backend_array', | |
frontend_input = 'multiselect', | |
backend_type = 'varchar', | |
source_model = NULL WHERE eav_attribute.attribute_id = 137; | |
INSERT INTO catalog_product_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, `value`) | |
SELECT entity_type_id, attribute_id, store_id, entity_id, `value` FROM catalog_product_entity_int WHERE attribute_id = 137; | |
DELETE FROM catalog_product_entity_int WHERE attribute_id = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment