Upgrade database.sql

Store manager is not working for me, plus i have so many tpl design changes i’ve decided i’ll start again with the new 1.3.5 and redo my skin, so all i want to do is convert my database to the new 1.3.5 structure. I’ve been manually updating my 1.3.4 database using the upgrade.sql file included in the update, but i’ve found some tables missing and some wrong queries.



Missing tables:

lm_list_objects

lm_list_type_descriptions

lm_list_types

lm_list_lists

order_status_data

stat_ip2nation_countries



Wrong queries:

I’ll only post the first on list otherwise this page will get too long.


REPLACE INTO `cscart_countries` (code, code_A3, code_N3, region, lat, lon, avail) VALUES ('PS', 'PSE', '275', 'AS', '31.89', '34.9', 'Y');


and


UPDATE `cscart_countries` SET code_A3='AFG', code_N3='4', region='AS', lat='33', lon='65', avail='Y' WHERE code='AF';




There are no ‘lat’ or ‘lon’ fields in the table ‘countries’, these fields are in stat_ip2nation_countries.



I’ve been able to add the missing tables using the 1.3.5 table scheme posted somewhere elase on the forum, but i’m not sure what to do about these missing fileds. I’ll try ading the fields to the ‘countries’ table run the last of the queries and see what happens ( i’ll also have to run the post_upgrade.php on the database to remove unused tables).

Charlie-



Have you notified the developers about the missing tables and other issues with the upgrade database.sql file?



Bob

[quote name=‘baballuci’]Store manager is not working for me, plus i have so many tpl design changes i’ve decided i’ll start again with the new 1.3.5 and redo my skin, so all i want to do is convert my database to the new 1.3.5 structure. I’ve been manually updating my 1.3.4 database using the upgrade.sql file included in the update, but i’ve found some tables missing and some wrong queries.



Missing tables:

lm_list_objects

lm_list_type_descriptions

lm_list_types

lm_list_lists

order_status_data

stat_ip2nation_countries



Wrong queries:

I’ll only post the first on list otherwise this page will get too long.


REPLACE INTO `cscart_countries` (code, code_A3, code_N3, region, lat, lon, avail) VALUES ('PS', 'PSE', '275', 'AS', '31.89', '34.9', 'Y');


and


UPDATE `cscart_countries` SET code_A3='AFG', code_N3='4', region='AS', lat='33', lon='65', avail='Y' WHERE code='AF';




There are no ‘lat’ or ‘lon’ fields in the table ‘countries’, these fields are in stat_ip2nation_countries.



I’ve been able to add the missing tables using the 1.3.5 table scheme posted somewhere elase on the forum, but i’m not sure what to do about these missing fileds. I’ll try ading the fields to the ‘countries’ table run the last of the queries and see what happens ( i’ll also have to run the post_upgrade.php on the database to remove unused tables).[/QUOTE]

I ran into the same problem. The reason is the category configuration is different for the 1.3.4 version. Download a your catalog for your updated 1.3.5 version and you will see what I mean. So in effect you need to try to get store manager to work so that it automatically converts the tables in your database.

babalucci-



I was looking around the database and am wondering why there are so many discrepancies. It appears that some of the tables you find missing are named differently on my install:



lm_list_objects → listmania_list_objects

lm_list_type_descriptions → listmania_list_type

lm_list_types → listmania_list_types

lm_list_lists → listmania_list_lists

order_status_data → status_data

stat_ip2nation_countries (could not find this table)



I also found that I have ‘lon’ and ‘lat’ columns in the countries table.



I did a clean install of 1.3.5 but I also looked at database.sql in the upgrade package and found the following startingat line 13:


CREATE TABLE IF NOT EXISTS `cscart_listmania_list_objects` ( `lm_id` int(11) unsigned NOT NULL DEFAULT '0' , `list_object_id` int(11) unsigned NOT NULL DEFAULT '0' , `related_id` int(11) unsigned NOT NULL DEFAULT '0' , `extra` int(11) unsigned NOT NULL DEFAULT '0' , PRIMARY KEY (`lm_id`,`list_object_id`,`related_id`) ) Type=MyISAM;
CREATE TABLE IF NOT EXISTS `cscart_listmania_list_type_descriptions` ( `list_id` int(11) unsigned NOT NULL DEFAULT '0' , `list` varchar(255) NOT NULL , `description` text NOT NULL , `lang_code` char(2) NOT NULL , PRIMARY KEY (`list_id`,`lang_code`) ) Type=MyISAM;
CREATE TABLE IF NOT EXISTS `cscart_listmania_list_types` ( `list_id` int(11) unsigned NOT NULL auto_increment , `object` int(11) unsigned NOT NULL DEFAULT '0' , `list_object` int(11) unsigned NOT NULL DEFAULT '0' , `type` int(11) unsigned NOT NULL DEFAULT '0' , `appearance_box` int(11) unsigned NOT NULL DEFAULT '0' , `appearance_order` int(11) unsigned NOT NULL DEFAULT '0' , `appearance_type` int(11) unsigned NOT NULL DEFAULT '0' , `position` int(11) unsigned NOT NULL DEFAULT '0' , `avail` char(1) NOT NULL DEFAULT 'Y' , `show_item_number` char(1) NOT NULL DEFAULT 'N' , `add_to_cart` char(1) NOT NULL DEFAULT 'N' , `on_separate_page` char(1) NOT NULL DEFAULT 'N' , `simultaneous_add` char(1) NOT NULL DEFAULT 'N' , `last_days` int(11) unsigned NOT NULL DEFAULT '1' , `period` int(11) unsigned NOT NULL DEFAULT '0' , `scroller_direction` int(11) unsigned NOT NULL DEFAULT '0' , `move_delay` int(11) unsigned NOT NULL DEFAULT '0' , `pause_delay` int(11) unsigned NOT NULL DEFAULT '0' , `speed_factor` int(11) NOT NULL DEFAULT '0' , `item_quantity` int(11) unsigned NOT NULL DEFAULT '1' , PRIMARY KEY (`list_id`) ) Type=MyISAM;
CREATE TABLE IF NOT EXISTS `cscart_listmania_lists` ( `lm_id` int(11) unsigned NOT NULL auto_increment , `list_id` int(11) unsigned NOT NULL DEFAULT '0' , `object_id` int(11) unsigned NOT NULL DEFAULT '0' , `enable` char(1) NOT NULL DEFAULT 'Y' , PRIMARY KEY (`lm_id`) , UNIQUE KEY `list_id` (`list_id`,`object_id`) ) Type=MyISAM;




It seems like there is more than one version of database.sql.



Bob

If you look at the 1.3.5 Table structure from this post, it does show both “lm” and “listmania” tables, not sure which ones are being used. But the layout does also shows “featured” and “related product” tables which are removed when post_upgrade.php is run, so i’m not too sure what the layout should actually be. When i get some time i may do a fresh install of 1.3.5 and compare the tables from the new install to the upgraded install.

I can confirm that my install does not have either the related_pruducts or featured_products tables (from a fresh install). It weird that those tables were not dropped when post_upgrade.php ran. Was data from those tables moved to the listmania tables?



Bob

Post_upgrade.php should populate listmania with featured products and related products and then remove both tables.

That’s what I was saying. Did you check to see if your featured and related products from 1.3.4 were moved to the listmania tables in 1.3.5. If not, it would seem that post_upgrade.php failed completely. If that is the case, you should be able to try running it again.



Bob

Mine worked fine.

Hmmm. Ever more curious.



Bob

Are you using the database.sql file from here?

No, I am not. I see that file adds the six missing tables at the top of the file. I also see where it adds the ‘lat’ and 'lon" columns in countries.



Since I did a fresh install, my DB is based on the scheme.sql in the 1.3.5 download (dated 10/5). I also reviewed the database.sql file from the upgrade download (also dated 10/5) and, for instance, found only the creates for the "listmania
" tables and no reference to “lm_” tables.



Where did the database.sql file in you manual upgrade package come from?



Bob

I modified it to include the missing tables and fields.

How did you determine that those tables and fields were missing?



In my stock installation, everything related to Listmania appears to be working and I have only the listmania_ tables. The appropriate country is also being shown in stats although I do not have the _ip2nation_country table.



Bob

From here. I assume that this document is still current.

I am not sure what to think since ET is always a reliable source for information. I wonder if he was working from some interim document taht was later updated.



At any rate, my installation does not include the tables listed as missing and is functioning fine. I have added Listmania lists in the admin area and confirmed that those list appear in the _listmania tables by inspecting the database directy. I have also confirmed that _countries have "lon’ and’lat’ columns populated with data.



I think that the scheme.sql file (in the full release package) and the database.sql file (in the upgrade package) should be considered authoritative and would not suggest anyone create the extra (duplicated but unused) tables when manually upgrading.



If I were doing a manual upgrade from 1.3.4-sp3, I would copy the files over (making appropriate adustments in config.php) and then run the SQL queries in the database.sql included in the upgrade pckage. I would finish by executing post_upgrade.php and then start updating for changes I made to my .tpl files…



Extra caution is warranted if you have a non-standard database schema in 1.3.4-sp3.



Bob

My database is an upgrade from 1.3.3, although works ok with 1.3.4sp3 i know for a fact that i don’t have a drop down menu for UK states/counties which i would have had with a fresh 1.3.4sp3 install, this was obviously missing from that upgrade.



Since your 1.3.4sp3 database file has the lon and lat in countries, this may have also been missed from the previous upgrade.

[quote name=‘baballuci’]My database is an upgrade from 1.3.3, although works ok with 1.3.4sp3 i know for a fact that i don’t have a drop down menu for UK states/counties which i would have had with a fresh 1.3.4sp3 install, this was obviously missing from that upgrade.



Since your 1.3.4sp3 database file has the lon and lat in countries, this may have also been missed from the previous upgrade.[/QUOTE]



All my comments are based on a clean install of the full installation package from the file area. The ‘lon’ and ‘lat’ fields are in the _countries table after doing the install.



What I am trying to say is that I believe people need to use the database.sql file in the official upgrade package from CS-Cart instead of the file referenced in the other thread. The discrepancies noted seem to reflect the exact differences between those two files.



This is not meant to slight anyone but the official CS-Cart version of database.sql (which also is consistent with scheme.sql in the full install package) is the authoritative package - it (and the resulting databases) are what the developers are expecting to find should they get involved in support of a site.



Additionally, post_upgrade.php only makes changes to the officially specified tables. I am pretty sure a quick look at _lm_list_type_descriptions will prove to be empty while reviewing _listmania_list_type_descriptions will have Featured and Related products (at a minimum) resulting from the queries in post_upgrade,php.



Bob

So your saying your fresh install of 1.3.5 doesn’t have any references to lm_list… tables at all? I’ve just done an install myself and the tables are there, although as you say they are empty.



REPLACE INTO `cscart_countries` (code, code_A3, code_N3, region, lat, lon, avail) VALUES ('PS', 'PSE', '275', 'AS', '31.89', '34.9', 'Y');




The query above from the upgrade sql file was never going to work for me as i didn’t have the ‘lon’ and ‘lat’ fields in ‘countries’, i’m was also missing the ‘order_status_data’ table which 1.3.5 has.



I’m not telling people to use the other database.sql file instead, but just telling people why this doesn’t work for me. This could be because i had originally upgraded from 1.3.3 i don’t know.



Surely after the upgrade the tables in a fresh install and an upgrade should be identical. When i do an upgrade i only have 198 tables instead of 208 from a fresh install. What’s that all about? This is why my 1.3.4sp3 cart doesn’t work the same as a fresh install of 1.3.4sp3, obviously the upgrade from 1.3.3 to 1.3.4 wasn’t right either.

you don’t have to do anything of these… we have put together the MOD and need your final input before release. Check here