Created
February 26, 2019 02:09
-
-
Save brunoconstantino/fa3b5f3012ad58c50649e554e40b343e to your computer and use it in GitHub Desktop.
SQL Vínculo de Imagens Magento
This file contains hidden or 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
/* | |
* Este UPDATE faz o vinculo da segunda imagem (mgv.position) com o atributo small_image (86) | |
* 85, 86, 87 -> base_image, small_image, thumbnail | |
* OS ID's variam de cada base Magento, verifique na tabela eav_attribute. | |
*/ | |
UPDATE catalog_product_entity_media_gallery AS `mg`, | |
catalog_product_entity_media_gallery_value AS `mgv`, | |
catalog_product_entity_varchar AS `ev` | |
SET `ev`.`value` = `mg`.`value` | |
WHERE `mg`.`value_id` = `mgv`.`value_id` | |
AND `mg`.`entity_id` = `ev`.`entity_id` | |
AND `ev`.`attribute_id` IN (86) | |
AND `mgv`.`position` = 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment