Archive for December, 2010

Magento Delete Products and Categories

Published by calhoun on December 23rd, 2010 - in Magento

Magento LogoThe database structure used in Magento can be very complex to new starts – hence why recently I outsourced a major database manipulation project.

Part of this project involves wiping the database of products and categories frequently. So I decided to put this post into place – not because its nesessary original discovered or particuarily interesting. I created it simply so I can easily come back to the information I need when I am cleaning the database on test runs I got bored having to google each time and as you’ll see this is not exactly easy to remember.

Delete Categories:


TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
TRUNCATE TABLE `catalog_product_entity_tier_price`;
TRUNCATE TABLE `catalog_product_entity_varchar`;
TRUNCATE TABLE `catalog_product_link`;
TRUNCATE TABLE `catalog_product_link_attribute`;
TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
TRUNCATE TABLE `catalog_product_link_attribute_int`;
TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
TRUNCATE TABLE `catalog_product_link_type`;
TRUNCATE TABLE `catalog_product_option`;
TRUNCATE TABLE `catalog_product_option_price`;
TRUNCATE TABLE `catalog_product_option_title`;
TRUNCATE TABLE `catalog_product_option_type_price`;
TRUNCATE TABLE `catalog_product_option_type_title`;
TRUNCATE TABLE `catalog_product_option_type_value`;
TRUNCATE TABLE `catalog_product_super_attribute`;
TRUNCATE TABLE `catalog_product_super_attribute_label`;
TRUNCATE TABLE `catalog_product_super_attribute_pricing`;
TRUNCATE TABLE `catalog_product_super_link`;
TRUNCATE TABLE `catalog_product_enabled_index`;
TRUNCATE TABLE `catalog_product_website`;
TRUNCATE TABLE `catalog_product_entity`;

TRUNCATE TABLE `cataloginventory_stock`;
TRUNCATE TABLE `cataloginventory_stock_item`;
TRUNCATE TABLE `cataloginventory_stock_status`;

insert  into `catalog_product_link_type`(`link_type_id`,`code`) values (1,'relation'),(2,'bundle'),(3,'super'),(4,'up_sell'),(5,'cross_sell');
insert  into `catalog_product_link_attribute`(`product_link_attribute_id`,`link_type_id`,`product_link_attribute_code`,`data_type`) values (1,2,'qty','decimal'),(2,1,'position','int'),(3,4,'position','int'),(4,5,'position','int'),(6,1,'qty','decimal'),(7,3,'position','int'),(8,3,'qty','decimal');
insert  into `cataloginventory_stock`(`stock_id`,`stock_name`) values (1,'Default');
Delete Categories:

TRUNCATE TABLE `catalog_category_entity`;
TRUNCATE TABLE `catalog_category_entity_datetime`;
TRUNCATE TABLE `catalog_category_entity_decimal`;
TRUNCATE TABLE `catalog_category_entity_int`;
TRUNCATE TABLE `catalog_category_entity_text`;
TRUNCATE TABLE `catalog_category_entity_varchar`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `catalog_category_product_index`;

insert  into `catalog_category_entity`(`entity_id`,`entity_type_id`,`attribute_set_id`,`parent_id`,`created_at`,`updated_at`,`path`,`position`,`level`,`children_count`) values (1,3,0,0,'0000-00-00 00:00:00','2009-02-20 00:25:34','1',1,0,1),(2,3,3,0,'2009-02-20 00:25:34','2009-02-20 00:25:34','1/2',1,1,0);
insert  into `catalog_category_entity_int`(`value_id`,`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) values (1,3,32,0,2,1),(2,3,32,1,2,1);
insert  into `catalog_category_entity_varchar`(`value_id`,`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) values (1,3,31,0,1,'Root Catalog'),(2,3,33,0,1,'root-catalog'),(3,3,31,0,2,'Default Category'),(4,3,39,0,2,'PRODUCTS'),(5,3,33,0,2,'default-category');

Her Majesties Head Could Come Off…

Published by calhoun on December 19th, 2010 - in News, Politics

Royal Mail 1st Class Stamp … the stamps of the postal service.

You might not think that this is an important element of the post system but the main postal operator, the Royal Mail is a Royal service which is why Her Majesties head is on postal stamps. In the event that plans to privatize the Royal Mail are pushed ahead with, then there is the chance that the new organization may wish to remove the Queens head from postage stamps.

Buckingham Palace has been in negotiations with ministers to ensure that the head should remain stuck on the stamp should the privatization go ahead. To think that with a multi billion pound deficit and international wars on multiple fronts that the Queen thinks her head being on a stamp is an important issue to take up ministers time with. I for one support removing the queens head even if privatisation doesn’t go ahead.

The legislation set forth for privatisation requires that any organizations which wish to use the monarch’s head must get royal approval first. But the business secretary indicates there is no perogative in the legislation that mandatorily requires them to even use the image of the monarch at all.

References
Telegraph

Iceland agrees to repay the UK for bank collapse

Published by calhoun on December 10th, 2010 - in News, Politics

Credit CrunchGordon Brown once said: “We are facing a global financial crisis which is probably the first truly global financial crisis of the modern world”. A statement which went on to prove to be accurate with the worldwide financial system collapsing around us it is no surprise that commercial entities were forced to close their doors to the public.

One of the biggest losers in this financial game of high risk investment where the risk outweighed the gain was the Icelandic banks. How many of us would expect to invest in a risky venture and be guaranteed our money back at the end of it? This is essentially what has been stalling negotiations over the last two years.

The collapse of the bank left many accounts out of pocket and the government issued a loan to the Icelandic government to ensure they could pay up for the closure of the banks.

Britain faced its share of troubles in this but companies that closed down as a result of the crisis and our vastly state owned banks dont even pay us dividends for the huge profits they are now paying. Nor do they seem interested in paying back money given to them in investment form by the government. Why should our banks be different from the Icelandic ones?

In a refferendum, Iceland voted 93% against an interest rate of 5% on the loan to Britain branding it an excessive interest rate which it quite rightly is excessive. The government should bear the responsibility of the loss and write off all interest on the loan – call it a we’re saving the world act.

References
Telegraph
Telegraph

United States should take responsibility for Wikileaks

Published by calhoun on December 8th, 2010 - in News, Politics

Dilbert Data SecurityIf Wikileaks has been acting like a terrorist organization it is most likely because the United States is trying to push the blame for the leak on Wikileaks. That is not however entirely accurate, we are referring of course to predominately United States Military and Diplomatic reports.

They key word there: United States.

United States Military Personnel and Diplomatic Staff have generated the reports, passed it on to their superiors, or their superiors secretaries whom in turn handed it in to their superiors most likely. So for every document that’s at least 3 people have seen it, although i would be surprised if it was just 3 there’s probably a whole bunch of personnel have access to the information.

This is where the leak came form, not from Australia, Julian Assange is by no means responsible for causing the leak – at most he might be responsible for distribution of the information but how is that different from what Blogger have done in response to the documents, likewise the news channels and papers around the world have reiterated some of the information. Does that mean we all need to hand ourselves in?

The problem lies with the United States personnel whom likely have commited Treason by releasing these documents to unauthorized parties. There is where justice must be sought. More importantly, given the scale of the security breach it must really bring into question how much trust countries can place in the United States in its position of dominance.

The release of the cables are a strong indicator that the United States does not take national security that seriously and should not be trusted with any information of a sensitive nature. Until such a time as they start considering this a serious problem countries must view discussions with US Personnel as something that will inevitably fall into the hands of unauthorized persons.

Australian foreign minister Kevin Rudd dismissed US diplomatic comments regarding him that came out from wikileaks as irrelevant – which it entirely is – it does not effect his ability to do his job. He has judged however that the US should consider this problem and deal with the culprits of the crime instead of using Assange as a scapegoat.

References
Guardian

Julian Assange Arrested – Eyes shift to Watch Sweden

Published by calhoun on December 7th, 2010 - in News, Politics

Julian AssangeThe founder of Wikileaks, Julian Assange has officially been arrested in the United Kingdom under an European Arrest Warrant issued by the Swedish authorities over sexual crimes. Assange has of course denied the allegations. The real question is how will the case play out, being now a high profile defendant, people are going to watch carefully how Sweden plays this out.

The slightest suspicion that this case has really been brought around by the United States would seriously damage the Swedish Government’s international reputation.

According to Reuters he turned himself in – possibly on the advice of his legal team which would show confidence in their ability to secure a not guilty verdict in the allegations made against him. Now that he has formally been arrested he will be brought in front of magistrates to have an extradition hearing date set. It is a requirement that this occurs within 21 days of his arrest. The outcome of said hearing will determine weather or not he is extradited to Sweden for them to conduct their trial against him.

His Swedish Lawyer has stated he will fight the extradition so if he is ordered to be extradited at the hearing it is likely an appeal will be made in Britain to the court of appeal so it is likely to tie up the case in the justice system for months before getting anywhere. The Swedish lawyer has indicated he believes that foreign influence[which is of course widely believed to be the United States] have an unjustified influence over the Swedish government in this case. If this is the case there is a good chance that the judge here may rule that extradition might breach his Human Rights and consequently deny the extradition to Sweden on these grounds.

References
Reuters

Governor: You criticised our Prime Minister, that not accepted here.

Published by calhoun on December 1st, 2010 - in News, Politics

Govner of the Bank of EnglandHe holds the position of Governor of the Bank of England. Quite an impressive job title if I do say so myself. However he is facing calls for him to resign from said position for he expressed concerns about Prime Minister David Cameron and Chancellor George Osborne.

He really should have know better. This is Britain, we Do not critisize our political figures and we definately do not express concern over their abilities. Its not like we live in a democratic state which values freedom of expression anyway.

Wait a second, isnt that one of our more important values? Well, we are a part of the European Union, so surely Article 11 of the european convention should apply even to our citizens.

Political figures, and even the governor are in the limelight of the public interest critisism from fellow peers and more importantly by the people that put them in the job – the voters is not only expected is mandatory. Without opening debat about the actions of our representatives and having the freedom to express ourselves against their actions without fear of reprimand like they do in such states as the Peoples Republic of China or Iran how can we possibility life a life where progress is put above the political interest of one political figure.

He informed the US ambassador that he belived the now Prime Minister lacked the experience to run the country, well who does if they havent done it allready?

References
The Gaurdian
The Telegraph
Article 11 EU

© Copyright (c) 2011 Whitebunnywabbit
Web design manchester Textmimedia
Digital Photography at Digitcal