Skip to content

Instantly share code, notes, and snippets.

@fwg
Created August 23, 2011 14:24
Show Gist options
  • Save fwg/1165259 to your computer and use it in GitHub Desktop.
Save fwg/1165259 to your computer and use it in GitHub Desktop.
Insert product status attribute for products that don't have it
INSERT INTO catalog_product_entity_int
(entity_type_id,attribute_id,store_id,entity_id,value)
SELECT
4 AS entity_type_id,
80 AS attribute_id,
0 AS store_id,
product.entity_id,
1 AS value
FROM
catalog_product_entity product
LEFT JOIN catalog_product_entity_int status
ON (status.entity_id=product.entity_id and status.attribute_id=80)
WHERE
status.value IS NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment