Topic: error while update database from older versions

Desc:

Drupal 4.4.0 database.mysql file say:

--
-- Table structure for table 'boxes'
--

CREATE TABLE boxes (
bid tinyint(4) NOT NULL auto_increment,
title varchar(64) NOT NULL default '',
body longtext,
info varchar(128) NOT NULL default '',
type tinyint(2) NOT NULL default '0',
PRIMARY KEY (bid),
UNIQUE KEY subject (title),
UNIQUE KEY info (info)
) TYPE=MyISAM;

If you try update your database 4.4.0 -> 4.6.0 -> 4.6.5 everything is OK.

But if you continue the update process, and try to update 4.6.5 -> 4.7.0-beta{1-2-3} you get following error message:

Update #131

* Failed: ALTER TABLE {boxes} DROP INDEX title

Solution:

Before you try to update from 4.6.5 to 4.7.0-beta{1-2-3}:

ALTER TABLE `boxes` DROP INDEX `subject` ,
ADD UNIQUE `title` ( `title` );

Comments

mfb’s picture

Looks like this is actually a missing database update which should have happened between drupal 4.4 and 4.5. The boxes.title index was renamed from `subject` to `title`. Not sure how to add a database update which should have happened some time ago. We could perhaps remove both indexes, with some error suppression since it would be "normal" for one of the indexes to not exist.

mfb’s picture

Version: 4.6.5 » 4.7.0-beta3

This bug is only apparent when upgrading to 4.7 beta.

dries’s picture

Priority: Critical » Normal

Something is wrong but an index that can' t be dropped isn't necessarily a critical bug.
Is your upgraded boxes table identical to the one in database/database.mysql?

mcduarte2000’s picture

Version: 4.7.0-beta3 » 4.7.0-beta5

I had the same problem... I took the index by hand and it seemed to work.

gerhard killesreiter’s picture

Version: 4.7.0-beta5 » 4.7.0
Status: Active » Fixed

Probably some people added/removed indices by themselves.

Anonymous’s picture

Status: Fixed » Closed (fixed)