Bug #44815 | cannot add self referential foreign key with ALTER TABLE | ||
---|---|---|---|
Submitted: | 12 May 2009 7:54 | Modified: | 12 May 2009 8:26 |
Reporter: | Stewart Smith | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 6.0.10 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[12 May 2009 7:54]
Stewart Smith
[12 May 2009 8:26]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php You missed column reference from ALTER TABLE. Change "alter table messages add constraint fk_next_message foreign key (next_message_id) references messages;" to "alter table messages add constraint fk_next_message foreign key (next_message_id) references messages(message_id);"