List:General Discussion« Previous MessageNext Message »
From:Gabriel PREDA Date:June 21 2006 10:18am
Subject:Re: problem with altering a table
View as plain text  
When creating the InnoDB table the InnoDB engine asigns to the FOREIGN
KEY you defined a symbol.

On my server it generated "dbmail_messageblks_ibfk_1"... and if in the
ALTER statement I entered:

   DROP FOREIGN KEY dbmail_messageblks_ibfk_1

Then the ALTER table worked fine...

If you want to continue with this you should add a symbol name
manually like this in the create table statement:

CONSTRAINT `fk_message_idnr_manually_set`  FOREIGN KEY
(`message_idnr`) REFERENCES `messages` (`message_idnr`)

Now in the ALTER statement you will have to write before you change
the name of the column:
   DROP FOREIGN KEY `fk_message_idnr_manually_set`

If you DROP an index a FOREIGN KEY based on that index will not be
dropped automaticaly...

Hope this helps !

-- 
Gabriel PREDA
Senior Web Developer
Thread
problem with altering a tableAlex20 Jun
  • Re: problem with altering a tableAlex21 Jun
    • Re: problem with altering a tableGabriel PREDA21 Jun
      • [SOLVED] Re: problem with altering a tableAlex21 Jun