Upgrade database.sql

[quote name=‘baballuci’]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.[/QUOTE]

Yes, I am saying that after doing a fresh install I have no _lm_list… tables in my DB. This is the DB that results from scheme.sql in the full install package. I ran the install on a newly-created empty database.


[QUOTE]


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.[/QUOTE]

The ‘order_status_data’ table you reference seems to have reverted to the ‘status_data’ (which was in 1.3.4-sp3) in the scheme.sql and the official database.sql in the upgrade package.



You are correct that the above queries would fail when doing the upgrade. I cannot find the ‘lon’ and ‘lat’ columns added to the ‘_countries’ table in the official database.sql. You should let the developers know about this if it is not already reported in the Bug Tracker.



This is not an issue when doing a fresh install since the scheme.sql includes the following starting at line 409:

DROP TABLE IF EXISTS cscart_countries;
CREATE TABLE `cscart_countries` (
`code` char(2) NOT NULL default '',
`code_A3` char(3) NOT NULL default '',
`code_N3` int(4) NOT NULL default '0',
`region` char(2) NOT NULL default '',
[COLOR="Red"]`lat` float NOT NULL default '0',
`lon` float NOT NULL default '0',[/COLOR]
`avail` char(1) NOT NULL default 'Y',
PRIMARY KEY (`code`),
KEY `avail` (`avail`)
) TYPE=MyISAM;



[QUOTE]

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.[/QUOTE]



We agree that the number of tables should be the same whether the result of a fresh install or an upgrade. However, I have only a 198 tables after doing a fresh install. I would expect there to be [COLOR=“Red”]204[/COLOR] tables if you used the unofficial database.sql in your manual upgrade instructions since, as you said above (#13), you modified it by adding the first six lines which do not appear in the official database.sql:

CREATE TABLE `cscart_lm_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 `cscart_lm_list_type_descriptions` ( `list_id` int(11) unsigned NOT NULL default '0', `list` varchar(255) collate latin1_general_ci NOT NULL default '', `description` text collate latin1_general_ci NOT NULL, `lang_code` char(2) collate latin1_general_ci NOT NULL default '', PRIMARY KEY (`list_id`,`lang_code`) ) Type=MyISAM;
CREATE TABLE `cscart_lm_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) collate latin1_general_ci NOT NULL default 'Y', `show_item_number` char(1) collate latin1_general_ci NOT NULL default 'N', `add_to_cart` char(1) collate latin1_general_ci NOT NULL default 'N', `on_separate_page` char(1) collate latin1_general_ci NOT NULL default 'N', `simultaneous_add` char(1) collate latin1_general_ci NOT NULL default 'N', `last_days` int(11) unsigned NOT NULL default '1', `period` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`list_id`) ) Type=MyISAM;
CREATE TABLE `cscart_lm_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', PRIMARY KEY (`lm_id`), UNIQUE KEY `list_id` (`list_id`,`object_id`) ) Type=MyISAM;
CREATE TABLE `cscart_order_status_data` ( `status` char(1) collate latin1_general_ci NOT NULL default '', `type` char(1) collate latin1_general_ci NOT NULL default 'O', `param` char(255) collate latin1_general_ci NOT NULL default '', `value` char(255) collate latin1_general_ci NOT NULL default 'Y', PRIMARY KEY (`status`,`type`,`param`), KEY `inventory` (`value`) ) Type=MyISAM;
CREATE TABLE `cscart_stat_ip2nation_countries` ( `code` varchar(4) collate latin1_general_ci NOT NULL default '', `country` varchar(255) collate latin1_general_ci NOT NULL default '', `lat` float NOT NULL default '0', `lon` float NOT NULL default '0', PRIMARY KEY (`code`), KEY `code` (`code`) ) Type=MyISAM;




This, by the way, is consistent with the results posted by another member here. The Store Manager is using the official database.sql in the upgrade package.



You based your database.sql on the schema which ET posted which, for whatever reason, is not consistent with the official schema from the developers. I am guessing that all six tables you created are, in fact, empty. I suspect that if you removed the six tables you created in your file and left only the two column additions (‘lon’ and ‘lat’) that your manual upgrade would also complete without incident.



Since the official schema is what the developers will use for any future development, it is important that we report any errors resulting from its use.



To be honest, I think we agree that the upgrade was not as smooth as it should be and I hope our discussion has maybe helped some people to better understand both their options to do a manual upgrade and, perhaps, a little bit of what the database looks like.