[horde] horde webmail upgrade issue [workaround]

tom burkart horde at aussec.com
Mon Apr 20 03:45:05 UTC 2009


Quoting Jan Schneider <jan at horde.org>:

>> I have two issues with setup.php when upgrading from horde webmail
>> 1.0.6 to 1.2.2 (Apache 2.2.10, PHP 5.2.6, SUSE 11.1):
>> The output text of problem 1 is as follows:
>> Updating database...
>> [ ERROR! ] Reading the existing table structure failed. Error messages:
>> MDB2_Schema Error: schema validation error
>> default value of "pref_scope" is incorrect: "''::character varying" is
>> larger than "16"
This is still the case but does not affect the upgrade other than  
throwing the error and the user having to manually say "yes continue".

The other issues are caused by setup.php not updating some tables  
correctly and not generating missing tables.

WORKAROUND:
Apply the following SQL code:

ALTER TABLE kronolith_events ADD COLUMN event_recurtypeN SMALLINT;
UPDATE kronolith_events SET event_recurtypeN = event_recurtype::SMALLINT;
ALTER TABLE kronolith_events DROP COLUMN event_recurtype;
ALTER TABLE kronolith_events RENAME COLUMN event_recurtypeN TO  
event_recurtype;

ALTER TABLE kronolith_events ADD COLUMN event_recurintervalN SMALLINT;
UPDATE kronolith_events SET event_recurintervalN =  
event_recurinterval::SMALLINT;
ALTER TABLE kronolith_events DROP COLUMN event_recurinterval;
ALTER TABLE kronolith_events RENAME COLUMN event_recurintervalN TO  
event_recurinterval;

ALTER TABLE kronolith_events ADD COLUMN event_recurdaysN SMALLINT;
UPDATE kronolith_events SET event_recurdaysN = event_recurdays::SMALLINT;
ALTER TABLE kronolith_events DROP COLUMN event_recurdays;
ALTER TABLE kronolith_events RENAME COLUMN event_recurdaysN TO  
event_recurdays;

ALTER TABLE kronolith_events ADD COLUMN event_recurcount INT;
ALTER TABLE kronolith_events ADD COLUMN event_private INT DEFAULT 0 NOT NULL;

ALTER TABLE nag_tasks ADD COLUMN task_parent VARCHAR(32);
ALTER TABLE nag_tasks ADD COLUMN task_start INT;
ALTER TABLE nag_tasks ADD COLUMN task_estimate FLOAT;
ALTER TABLE nag_tasks ADD COLUMN task_completed_date INT;
-- ALTER TABLE nag_tasks ALTER COLUMN task_private TYPE SMALLINT <rest  
done by upgrade script but not in default setup> DEFAULT 0 NOT NULL;

Subsequently apply the horde-webmail new database SQL code as the  
horde database user.  Yes, this seems somewhat dodgy but works due to  
the fact that PostgreSQL rejects code for already existing tables.

Now run setup.php and things are a lot smoother.

tom




More information about the horde mailing list