Forums / Setting Up Categories, Products, Attributes / Database v1.3.8a how subcategories are referenced to issue SQL commands?

Database v1.3.8a how subcategories are referenced to issue SQL commands?

Views: 836

Results 1 to 3 of 3
27 Apr 2011, 8:05 PM
#1
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Database v1.3.8a how subcategories are referenced to issue SQL commands?

I need to change over 100 subcategories, in fact move them to another category, if I use the admin interface, I have to go one by one, which will be too slow(and prone to errors). So I want to know how they are related in the database, which index I have to modify to make the subcategories point to their new category, as none of the products are linked, there should be no problems if I do that(as far as products linked to master categories are concerned). My guess is, there is an index that points the subcat to their parent, but as I don't know all the tables relationships, and I don't want to make a mess by modifying the wrong thing or do a partial modification, then which tables I have to look, if I want to accomplish this?

28 Apr 2011, 12:10 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Database v1.3.8a how subcategories are referenced to issue SQL commands?

Truly, if you are asking - - You are not adept enough in mysql or ZenCart DB structure to attempt this

I don't want to make a mess by modifying the wrong thing
That is why one should ALWAYS backup before this and actually not do this on a live install DB

Create a test install with its own DB and import a backup of the DB and mess with it

Zen-Venom Get Bitten

3 May 2011, 7:38 AM
#3
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: Database v1.3.8a how subcategories are referenced to issue SQL commands?

kobra:

Truly, if you are asking - - You are not adept enough in mysql or ZenCart DB structure to attempt this

That is why one should ALWAYS backup before this and actually not do this on a live install DB

Create a test install with its own DB and import a backup of the DB and mess with it

Well I am working on the live site and frankly so far I only used SQL sets of commands and I'm moving and deleting things pretty well. I studied the tables involved and after that and some successful experiments I was able to find a logical pattern and understand the way tables are related, however I didn't find a fast way to do massive updates, other than long lists of commands. It's working fine, as there is no way it will affect anything else, although what I want is to find a better way to do it as is also time consuming, faster than the admin though ... as the SQL is executed directly ...