2013 July

Magento – SQLSTATE[HY000]: General error: 1025 Error on rename of – report_compared_product_index and report_viewed_product_index

Posted by | Reference | No Comments

SQL error when attempting to upgrade Magento across 1.4.2 –> 1.7

/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php

Run the following SQL to drop the following two tables and recreate as key violations from previous versions across to 1.6 causes errors.


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `report_compared_product_index`
--
DROP TABLE IF EXISTS `report_compared_product_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_compared_product_index` (
`index_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`visitor_id` int(10) unsigned DEFAULT NULL,
`customer_id` int(10) unsigned DEFAULT NULL,
`product_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned DEFAULT NULL,
`added_at` datetime NOT NULL,
PRIMARY KEY (`index_id`),
UNIQUE KEY `UNQ_BY_VISITOR` (`visitor_id`,`product_id`),
UNIQUE KEY `UNQ_BY_CUSTOMER` (`customer_id`,`product_id`),
KEY `IDX_STORE` (`store_id`),
KEY `IDX_SORT_ADDED_AT` (`added_at`),
KEY `product_id` (`product_id`),
CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER` FOREIGN KEY (`customer_id`)
REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT` FOREIGN KEY (`product_id`)
REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`)
REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `report_viewed_product_index`
--
DROP TABLE IF EXISTS `report_viewed_product_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_viewed_product_index` (
`index_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`visitor_id` int(10) unsigned DEFAULT NULL,
`customer_id` int(10) unsigned DEFAULT NULL,
`product_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned DEFAULT NULL,
`added_at` datetime NOT NULL,
PRIMARY KEY (`index_id`),
UNIQUE KEY `UNQ_BY_VISITOR` (`visitor_id`,`product_id`),
UNIQUE KEY `UNQ_BY_CUSTOMER` (`customer_id`,`product_id`),
KEY `IDX_STORE` (`store_id`),
KEY `IDX_SORT_ADDED_AT` (`added_at`),
KEY `product_id` (`product_id`),
CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER` FOREIGN KEY (`customer_id`)
REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT` FOREIGN KEY (`product_id`)
REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`)
REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1348756 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

Samsung LE37M87BDX/XEU LCD TV – AUO 55.37T04.005 T-con board

Posted by | Project | No Comments

Watching TV one night at the weekend the screen began to flicker and the colours distorted that the picture didn’t look unlike a colour photograph negative.

I cringed but, thinking I had a John Lewis 5 year warranty still on the TV, I wasn’t overly worried. Monday came and I trotted off to ask them about repairs. However, lo and behold should the warranty not have run out on the Saturday! John Lewis wouldn’t and couldn’t see past themselves and I left with shrugged shoulders and a mission afoot.

After much forum searching and reading I concluded that my TV’s symptoms fitted mostly to the description of a fault with my T-CON board. “Right! Let’s buy one of those” I thought but, had a little bother in finding a suitable match.

AUO 55.37T04.005 T-con board

The joys of eBay! Finally finding a matching T-CON I hurriedly purchased said board and awaited it’s timely arrival. On fitting, which was a tad fiddly but not overly cumbersome, I switched the TV on for a test. *fffpt* it went and I really had thought I’d fused the whole thing. Though, turning off the TV and on again it fired up to a great picture and I left it on in the background to make sure it wasn’t going to burst into flames at any point!

You have to just love fixing things! :)

Magento SSH maintenance

Posted by | Reference | No Comments

What’s this all about? Well there’s various forum posts and great tips out there for maintaining your Magento installs. I’ve collated some of these together below for my own purposes and ease of access:


rm -rf downloader/pearlib/cache/*
rm -rf downloader/pearlib/download/*
rm -rf var/cache/*
rm -rf var/session/*
rm -rf var/report/*
rm -rf var/tmp/*


TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_event;
TRUNCATE catalogsearch_fulltext;
TRUNCATE catalogsearch_query;
TRUNCATE catalog_compare_item;


chmod -R 777 lib/PEAR
./pear mage-setup
./pear upgrade -f magento-core/Mage_All_Latest-stable
chmod 550 ./mage
./mage mage-setup .
./mage sync
./mage list-upgrades
./mage config-set preferred_state stable
./mage upgrade-all --force


find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

php -f index.php