Skip to content

Instantly share code, notes, and snippets.

@claudiu-marginean
Created February 8, 2016 14:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudiu-marginean/c8a2d1970246e590ee0f to your computer and use it in GitHub Desktop.
Save claudiu-marginean/c8a2d1970246e590ee0f to your computer and use it in GitHub Desktop.
Magento Change EAV Attribute type
#
# 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