Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11266 closed defect (bug) (fixed)

Database upgrade error on wp_options key

Reported by: nacin's profile nacin Owned by: ryan's profile ryan
Milestone: 2.9 Priority: normal
Severity: major Version: 2.9
Component: Database Keywords: needs-testing
Focuses: Cc:

Description

Updating to trunk, I got:

WordPress database error: [Incorrect table definition; there can be only one auto column and it must be defined as a key]
ALTER TABLE wp_options DROP INDEX option_id

This is the structure of wp_options.

CREATE TABLE wp_options (

option_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
blog_id int(11) NOT NULL DEFAULT '0',
option_name varchar(64) NOT NULL DEFAULT ,
option_value longtext NOT NULL,
autoload varchar(20) NOT NULL DEFAULT 'yes',
PRIMARY KEY (option_id),
UNIQUE KEY option_name (option_name),
UNIQUE KEY autoloaded_options (autoload,option_name),
KEY option_id (option_id)

)

Probably related: #2699, #10994.

Change History (6)

#1 @dd32
15 years ago

Just got the same on a SVN up to the latest nightly.
{{{WordPress database error: [Incorrect table definition; there can be only one auto column and it must be defined as a key]
ALTER TABLE wp3_options DROP INDEX option_id by wp_upgrade, pre_schema_upgrade}}}

#2 follow-up: @ryan
15 years ago

We might need to move the DROP/ADD for the primary to be above the DROP on option_id for the >=11557 <12217 case. Although that block is pretty worthless now and could probably just be dropped entirely.

#3 @westi
15 years ago

  • Keywords needs-testing added

Is this fixed by [12329]

#4 @nacin
15 years ago

I was just looking into it. I was hoping it would be, but after switching to an earlier revision then updating back to trunk:

WordPress database error: [Incorrect table definition; there can be only one auto column and it must be defined as a key]
ALTER TABLE wp1_options DROP INDEX option_id

#5 in reply to: ↑ 2 @nacin
15 years ago

Replying to ryan:

... the >=11557 <12217 case. Although that block is pretty worthless now and could probably just be dropped entirely.

That said, this would probably work.

#6 @nacin
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In [12365], thanks ryan.

Note: See TracTickets for help on using tickets.