Update database errors
| Project: | Custom filter |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | 6.x-1.0-beta2 |
Jump to:
Hi, when I tried to run update.php to the latest stable, I got these errors:
* Failed: ALTER TABLE {customfilter_filters} DROP PRIMARY KEY
* Failed: ALTER TABLE {customfilter_filters} CHANGE fid `fid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid)
* Failed: ALTER TABLE {customfilter_rules} CHANGE rid `rid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid)
* user warning: Multiple primary key defined query: ALTER TABLE prefix_customfilter_filters CHANGE fid `fid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid) in /ebs1/www/includes/database.mysql-common.inc on line 520.
* user warning: Multiple primary key defined query: ALTER TABLE prefix_customfilter_rules CHANGE rid `rid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid) in /ebs1/www/includes/database.mysql-common.inc on line 520.
What can I do?
Thanks!

#1
Until I cannot state differently, I will take the code has a bug.
I will investigate on this.
#2
The error seems caused by the fact the database engine doesn't allow to remove the primary key, when it is a serial field; as the first query fails to remove the primary key, also the second query (which adds a primary key that is already present) fails.
#3
The update function has been changed, and now it executes the following steps:
The code has been changed for the development snapshot, which will be used for the beta3 version I will make 4 days from now. You can install the development snapshot, or wait for the beta3.
Thanks for your report.
#4
Thanks a lot. :)
Will it be ok to just overwrite the current beta with the new dev and then run update.php?
#5
Yes, it will be. Development snapshots are compatible with the official releases, and I will always offer an update path from development snapshot to development snapshot, or from development snapshot to official release.
#6
#7
#8
#9
Automatically closed -- issue fixed for 2 weeks with no activity.