Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Created February 17, 2016 20:56
Show Gist options
  • Save molotovbliss/d2fd9bdf87fa0d12b121 to your computer and use it in GitHub Desktop.
Save molotovbliss/d2fd9bdf87fa0d12b121 to your computer and use it in GitHub Desktop.
Assign a New Attribute to All Attribute Sets
INSERT INTO `eav_entity_attribute` (
`entity_type_id`,
`attribute_set_id`,
`attribute_group_id`,
`attribute_id`,
`sort_order`
)
(
SELECT
'ENTITY_TYPE_ID' AS entity_type_id,
`attribute_set_id`,
`attribute_group_id`,
`attribute_id`,
'SORT_ORDER' AS `sort_order`
FROM `eav_attribute_group`, `eav_attribute`
WHERE `attribute_group_name` = 'General'
AND `attribute_code` = 'ATTRIBUTE_CODE'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment