Created
July 3, 2013 08:09
-
-
Save peterjaap/5916250 to your computer and use it in GitHub Desktop.
Convert select attribute to multiselect attribute SQL -- replace 'ATTRIBUTE_CODE' with your attribute code.
This file contains 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
SELECT @ATTRIBUTE_ID := attribute_id FROM eav_attribute WHERE attribute_code = 'ATTRIBUTE_CODE'; | |
UPDATE eav_attribute SET backend_model = 'eav/entity_attribute_backend_array', backend_type = 'varchar', frontend_input = 'multiselect' WHERE attribute_id = @ATTRIBUTE_ID; | |
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 = @ATTRIBUTE_ID; | |
DELETE FROM catalog_product_entity_int WHERE attribute_id = @ATTRIBUTE_ID; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment