Hello I am trying to drop a Primary key for a table and I am having some real challenges doing it.
Here is how I originally created the table:
/*
Add / Edit Comments about a user in the Admin Panel
*/
CREATE TABLE USER_COMMENTS
(
USER_ID INTEGER(11) UNSIGNED NOT NULL,
COMMENTS TEXT NOT NULL,
COMMENT_DATE DATETIME NOT NULL,
LAST_MODIFIED DATETIME NULL,
CONSTRAINT CONSTRAINT_PK_USER_COMMENTS
PRIMARY KEY PK_USER_COMMENTS_USER_ID (USER_ID),
CONSTRAINT CONSTRAINT_FK_USER_COMMENTS
FOREIGN KEY FK_USER_COMMENTS (USER_ID)
REFERENCES USERS (USER_ID)
ON DELETE RESTRICT
ON UPDATE CASCADE,
INDEX INDEX_USER_COMMENTS_COMMENT_DATE (COMMENT_DATE)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
Now i am trying to drop the primary key and change the column of the primary key using the following command:
ALTER TABLE USER_COMMENTS
DROP PRIMARY KEY;
And I am given the following error message:
Error on rename of ‘./users/#sql-1896_919’ to ‘./users/USER_COMMENTS’ (errno: 150)
Any help is highly appreciated.
P.S I have attached a text file with the above scripts in case you are interested.
Thank you in advance for your help.
Kind regards,
Mr. Alexander