busboy
August 8, 2012, 12:37am
1
[FONT=sans-serif][COLOR=#000000]I have a column called author that is set to null for all rows. When I try to drop the column using phpMyAdmin, I get the following error. Any ideas?
Thanks!
[/COLOR][/FONT]#1062 - Duplicate entry ‘shingles-keyword’ for key ‘author’
r937
August 8, 2012, 1:28am
2
could you do a SHOW CREATE TABLE please?
i don’t understand how dropping a column would create a duplicate entry
have you tried the actual SQL to do that task, instead of the phpmyadmin gui?
ALTER TABLE [I]tablename [/I]DROP COLUMN [I]columnname[/I]
busboy
August 8, 2012, 1:35am
3
Yes, I tried the actual SQL and got the same weird error.
CREATE TABLE searches
(
sID
int(7) NOT NULL AUTO_INCREMENT,
searchDate
datetime DEFAULT NULL,
uID
int(11) DEFAULT NULL,
author
mediumint(4) DEFAULT NULL,
type
varchar(8) DEFAULT NULL,
keyword
varchar(35) DEFAULT NULL,
results
smallint(4) DEFAULT NULL,
alerts
mediumint(3) DEFAULT ‘0’,
lastAlert
datetime DEFAULT NULL,
clicks
mediumint(3) DEFAULT ‘0’,
lastClick
datetime DEFAULT NULL,
timeStamp
timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (sID
),
UNIQUE KEY author
(author
,keyword
,type
),
FULLTEXT KEY keyword
(keyword
)
) ENGINE=MyISAM AUTO_INCREMENT=489807 DEFAULT CHARSET=latin1
r937
August 8, 2012, 2:08am
4
drop the unique key before you try to drop the column