[Koha] painful upgrade from 2.25 to 3.0.1: incomplete tables

Frederic Demians frederic at tamil.fr
Fri Mar 20 00:43:40 NZDT 2009


> the reason is that the zebraqueue table isn't as expected:
> CREATE TABLE `zebraqueue` (
> `id` int(11) NOT NULL auto_increment,
> `biblio_auth_number` int(11) NOT NULL default '0',
> `operation` char(20) NOT NULL default '',
> `server` char(20) NOT NULL default '',
> `done` int(11) NOT NULL default '0',
> `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
> PRIMARY KEY (`id`),
> KEY `zebraqueue_lookup` (`server`, `biblio_auth_number`, `operation`,
> `done`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
>
>
> but my actual table looks like:
> CREATE TABLE `zebraqueue` (
> `id` int(11) NOT NULL AUTO_INCREMENT,
> `biblio_auth_number` int(11) NOT NULL DEFAULT '0',
> `operation` char(20) NOT NULL DEFAULT '',
> `server` char(20) NOT NULL DEFAULT '',
> PRIMARY KEY (`id`)
> ) ENGINE=InnoDB AUTO_INCREMENT=9555 DEFAULT CHARSET=utf8;

In kohastructure.sql, you get:

CREATE TABLE `zebraqueue` (
  `id` int(11) NOT NULL auto_increment,
  `biblio_auth_number` int(11) NOT NULL default '0',
  `operation` char(20) NOT NULL default '',
  `server` char(20) NOT NULL default '',
  `done` int(11) NOT NULL default '0',
  `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`),
  KEY `zebraqueue_lookup` (`server`, `biblio_auth_number`, `operation`, 
`done`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


In update22to30.pl, you get:

zebraqueue    => "(
                    `id` int NOT NULL auto_increment,
                    `biblio_auth_number` int(11) NOT NULL default '0',
                    `operation` char(20) NOT NULL default '',
                    `server` char(20) NOT NULL default '',
                    PRIMARY KEY  (`id`)
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8 
COLLATE=utf8_general_ci AUTO_INCREMENT=1",
   
    ); 

IMHO, update22to30.pl should be updated itself.

But updatedatabase.pl does also tables upgrades depending on 
kohaversion.pl Koha version. So after an upgrade from 2 to 3 version. 
updatedatabase.pl will update required tables. For example zebraqueue:

ALTER TABLE `zebraqueue`
                    ADD `done` INT NOT NULL DEFAULT '0',
                    ADD `time` TIMESTAMP NOT NULL DEFAULT 
CURRENT_TIMESTAMP ;


-- 
Frédéric



More information about the Koha mailing list