Opened 15 years ago
Closed 15 years ago
#11266 closed defect (bug) (fixed)
Database upgrade error on wp_options key
Reported by: | nacin | Owned by: | 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 KEYoption_name
(option_name
),
UNIQUE KEYautoloaded_options
(autoload
,option_name
),
KEYoption_id
(option_id
)
)
Change History (6)
#2
follow-up:
↓ 5
@
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.
#4
@
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
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}}}