Opened 3 years ago
Closed 3 years ago
#11266 closed defect (bug) (fixed)
Database upgrade error on wp_options key
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Database | Version: | 2.9 |
| Severity: | major | Keywords: | needs-testing |
| 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)
)
Change History (6)
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.
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
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.

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}}}