Well, cut and paste strikes again... here it is with the missing portion....


On Fri, Dec 16, 2011 at 2:41 PM, Chris Nighswonger <cnighswonger@foundations.edu> wrote:
Moving this to the devel list....


On Fri, Dec 16, 2011 at 1:24 PM, Paul <paul.a@aandc.org> wrote:
At 12:51 PM 12/16/2011 -0500, Chris Nighswonger wrote:
Hi Paul,
[snip]

I see no reason why the errors you posted in this thread should/would affect the ability to put a server into production.

Hi Chris,

They don't -- it was just programmatical curiosity on my behalf (I have this very old-fashioned foible about trying to understand what I do.)


I'll help feed that old-fashioned "foible" since it will hopefully encourage you to jump into the development of Koha at some point. :-)
 
Here is an explanation I sent to another dev:

The cause for these errors is duplicate SQL in updatedatabase.pl. Take for example:


DBD::mysql::db do failed: Duplicate column name 'privacy' at /home/koha/kohaclone/installer/data/mysql/updatedatabase.pl <http://updatedatabase.pl> line 3997.

This particular error is a result of the 'privacy' column being added at line 2824:

http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=installer/data/mysql/updatedatabase.pl;h=0063a750980757e4b240a7cbbe1d3a24f1ad2903;hb=HEAD#l2824

So when we get to line 3997:

http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=installer/data/mysql/updatedatabase.pl;h=0063a750980757e4b240a7cbbe1d3a24f1ad2903;hb=HEAD#l3997

it is truly a duplicate as the error indicates.

Without digging into all of the errors, I think this is true for most, if not all of them. Some of this (iirc) was an attempt to fix out-of-sync databases. If this was truly necessary, the later attempt to add a column should have had code to check for the existence before attempting to add it.
 
<snip>

It should probably still be SOP to check for the existence of tables/columns/etc. prior to adding them. mysqldump does a similar sort of thing by default, proceeding every "CREATE TABLE" with such as this:

DROP TABLE IF EXISTS `foo`;

We could do something like:

UNLESS (<table> OR <column>) THEN <update-foo>

We could even add a function which could be called to do this to make it even easier to do.

Kind Regards,
Chris