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
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
#!/bin/bash | |
find vendor/ -type d -name ".git"|sed 's/\/\.git$//'|xargs -I % sh -c 'echo "-> %";cd %; git status -su;' |
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
RESET_SALES_SQL_FILE=reset_sales_tables_$(date +%s).sql && \ | |
( | |
mysqldump --add-drop-table --no-data -K -uroot -p***** DBNAME \ | |
`echo $(mysql -uroot -p***** DBNAME -e "SHOW TABLES LIKE 'sales_flat%';" | tail -n+2)` \ | |
`echo $(mysql -uroot -p***** DBNAME -e "SHOW TABLES LIKE 'sales%aggregated%';" | tail -n+2)` \ | |
| sed 's/ AUTO_INCREMENT=[0-9]*\b//' && \ | |
echo "UPDATE \`eav_entity_store\` SET \`increment_last_id\` = '100000000'" \ | |
"WHERE \`entity_type_id\` IN(SELECT \`entity_type_id\` FROM \`eav_entity_type\` WHERE \`entity_model\` LIKE 'sales/%');" | |
) > $RESET_SALES_SQL_FILE && \ | |
mysql -uroot -p***** DBNAME < $RESET_SALES_SQL_FILE && \ |
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
(MySQLDUMP_DATABASE=$(sed -n "s/^.*'db_name' => '\(.*\)'.*/\1/p" config.php | head -n1) \ | |
&& MySQLDUMP_IGNORE_TABLES=$( \ | |
mysql -h$(sed -n "s/^.*'db_host_name' => '\(.*\)'.*/\1/p" config.php | head -n1) \ | |
-u$(sed -n "s/^.*'db_user_name' => '\(.*\)'.*/\1/p" config.php | head -n1) \ | |
-p$(sed -n "s/^.*'db_password' => '\(.*\)'.*/\1/p" config.php | head -n1) \ | |
$MySQLDUMP_DATABASE \ | |
-e "SHOW TABLES LIKE '%_audit';" \ | |
| tail -n+2 \ | |
) && \ | |
mysqldump -h$(sed -n "s/^.*'db_host_name' => '\(.*\)'.*/\1/p" config.php | head -n1) \ |
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
alias gitstashpullrebasepop="HAS_STASH=\$(git stash) && git pull --rebase; RETVAL=\$?; test \$RETVAL -eq 0 -a \"\$HAS_STASH\" != \"No local changes to save\" && git stash pop; test \$RETVAL -ne 0 -a \"\$HAS_STASH\" != \"No local changes to save\" && echo 'Stashed changes:' && git stash list" | |
alias cc='test -d htdocs && HTDOCS="htdocs/" || HTDOCS="";rm -vrf "$HTDOCS"{var/{cache,full_page_cache}/*,media/{js,css}/*.{js,css}}|sed "s/mage--[0-9a-f]/mage--?/;s/mage---[A-Za-z0-9_-]\+/mage---*/"|sort -r|uniq -c' | |
alias cc+='test -d htdocs && HTDOCS="htdocs/" || HTDOCS="";test -d /tmp/magento && TMP_MAGENTO="/tmp/magento" || TMP_MAGENTO="";rm -vrf "$HTDOCS"{var/{cache,full_page_cache,session,report}/*,media/{{js,css}/*.{js,css},catalog/product/cache/*}} "$TMP_MAGENTO"|sed "s/mage--[0-9a-f]/mage--?/;s/mage---[A-Za-z0-9_-]\+/mage---*/;s/sess_[0-9a-z]\+/sess_*/;s/report\/[0-9]\+/report\/*/;s/media\/\(css\|js\)\/.\+/media\/\1\/*/;s/\(catalog\/product\/cache\/\).*/\1*/"|sort -r|uniq -c' |
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
#!/usr/bin/php | |
<?php | |
/** | |
* Debug an XML file | |
* @author Jochem Klaver <j.klaver@drecomm.nl> | |
* @link http://php.net/libxml | |
*/ | |
require('app/Mage.php'); | |
Mage::app(); |
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 cw.`website_id`, cw.`code` AS `website_code`, cw.`name` AS `website_name`, | |
cw.`is_default` AS `website_is_default`, cw.`default_group_id` AS `website_default_group_id`, | |
csg.`group_id`, csg.`name` AS `group_name`, csg.`default_store_id` AS `group_default_store_id`, | |
cs.`store_id`, cs.`code` AS `store_code`, cs.`name` AS `store_name`, cs.`is_active` AS `store_is_active`, | |
ccd_base_url.`value` AS `base_url`, ccd_base_url.`scope_scope_id` AS `base_url_scope`, | |
ccd_design_package.`value` AS `design_package`, ccd_design_package.`scope_scope_id` AS `design_package_scope`, | |
ccd_design_theme_layout.`value` AS `design_theme_layout`, ccd_design_theme_layout.`scope_scope_id` AS `design_theme_layout_scope`, | |
ccd_design_theme_template.`value` AS `design_theme_template`, ccd_design_theme_template.`scope_scope_id` AS `design_theme_template_scope`, | |
ccd_design_theme_skin.`value` AS `design_theme_skin`, ccd_design_theme_skin.`scope_scope_id` AS `design_theme_skin_scope` | |
FROM `core_store` AS cs |
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
#!/bin/sh | |
# From http://www.magentocommerce.com/wiki/magento_upgrade_from_1.6.0_1.6.1_or_1.6.2._to_1.7.0.0 | |
rm -rf var/cache/* var/session/* var/full_page_cache/* | |
chmod +x ./mage | |
./mage mage-setup . | |
./mage config-set preferred_state stable | |
./mage list-installed |
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
#!/usr/bin/php -q | |
<?php | |
ini_set('display_errors', 1); | |
require_once('./app/Mage.php'); | |
Mage::init(); | |
Mage_Core_Model_Resource_Setup::applyAllUpdates(); | |
Mage_Core_Model_Resource_Setup::applyAllDataUpdates(); |
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
<?php | |
// Init framework | |
require 'app/Mage.php'; | |
Mage::app(); | |
// Factory methods to search for | |
$methods = array( | |
'Mage::helper', | |
'Mage::getModel', | |
'Mage::getResourceModel', |
NewerOlder