Skip to content

Instantly share code, notes, and snippets.

@vdubyna
Created September 26, 2012 18:05
Show Gist options
  • Save vdubyna/3789559 to your computer and use it in GitHub Desktop.
Save vdubyna/3789559 to your computer and use it in GitHub Desktop.
Change Magento attribute type
INSERT INTO catalog_product_entity_text (`attribute_id`, `entity_id`, `entity_type_id`, `store_id`, `value`)
SELECT ev.`attribute_id`, ev.`entity_id`, ev.`entity_type_id`, ev.`store_id`, ev.`value`
FROM catalog_product_entity_varchar AS ev WHERE ev.`attribute_id` = ATTRIBUTE_ID;
UPDATE `eav_attribute` SET `backend_type`='text' WHERE `attribute_code`='ATTRIBUTE_CODE';
DELETE FROM catalog_product_entity_varchar WHERE `attribute_id` = ATTRIBUTE_ID;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment