• Welcome to KonaKart Community Forum. Please login or sign up.
 

different database migration scripts

Started by Iruñea, February 04, 2010, 11:04:54 am

Previous topic - Next topic

Iruñea

Hi!

Not totally sure but I think that in konakart v4.2.0.1 installation package for windows, the following script for upgrading the database (upgrade_3.2.0.0_to_4.0.0.0.sql) its missing this line:

# Just for MySQL
delete from kk_api_call where api_call_id = 221;


Because Im getting this MySQL error:
ERROR 1062 (23000) at line 27: Duplicate entry '221' for key 1

I beleave this comes because there exist a row with that id with which name is: forceRegisterCustomer

That line did exist (line 25) in the same script of the v4.1.0.0 installation package. So my question is: Is really the line missing or should I delete this other?
INSERT INTO kk_api_call (api_call_id, name, description, date_added) VALUES (221, 'setProductAvailability','', now());

Thanks!
Iruñea

heidi


You are safe to include that line as you saw in the 4.1.0.0 release version.

It looks like it's missing from the 4.2.0.1 release.

Thanks for bringing this up.


Iruñea


heidi

I've been looking into this a bit deeper.

Did you actually start off with a version earlier than 3200 and at some point run the upgrade_3.0.1.0_to_3.2.0.0.sql script?

I'm guessing you did.  Please can you confirm?


Iruñea

Hi Heidi!

Indeed, I migrated the database from v2.2.6.0. to  v4.2.0.1. After migrating till this last version I executed in my mysql database this two lines (to fix the missing line):

delete from kk_api_call where api_call_id = 221;
INSERT INTO kk_api_call (api_call_id, name, description, date_added) VALUES (221, 'setProductAvailability','', now());


But I got an error in konakart app so finally I decided to make a clean upgrade again from the begining this way:

This scripts from konakart 4.1.0.0 Installation package:
upgrade_2.2.6.0_to_3.0.1.0.sql
upgrade_3.0.1.0_to_3.2.0.0.sql
upgrade_3.2.0.0_to_4.0.0.0.sql
upgrade_4.0.0.0_to_4.1.0.0.sql

And this last two scripts from 4.2.0.1. installation package: (The highest version at this moment)
upgrade_4.1.0.0_to_4.2.0.0.sql
upgrade_4.2.0.0_to_4.2.0.1.sql

And I did not have any issues. :) At least till now but your question makes me think that maybe there's a problem if  I come from a version before 3.2.0.0. ?? Is this so ?

Thanks,
Iruñea

heidi

No... I looked into this...  there is no problem upgrading from 3.2.0.0 to 4.2.0.1 (or from versions prior to 3.2.0.0 to 4.2.0.1 assuming you use the corrected version of the 3.2.0.0 to 4.0.0.0 script as discussed below).

The problem only occurs because of the insert of the 221 record (forceRegisterCustomer) in the 3.0.1.0 to 3.2.0.0 upgrade script...

Therefore, if you have never run the upgrade_3.0.1.0_to_3.2.0.0.sql script there is no need to update the 3.2.0.0 to 4.0.0.0 script and all upgrades will run smoothly using the scripts in all the download packages.

I think we'll now "tone down" the warning message on our known problems page to clarify that this is only a problem for people coming from versions prrior to 3.2.0.0.

Thanks for your confirmation and raising the problem in the first place!

Heidi