I’m translating an old database SyBase to MySQL and I have this DDL Query:
ALTER TABLE "DBA"."tab_prodotto"
ADD FOREIGN KEY "fkey_idlinea" ("tpr_idlin")
REFERENCES "DBA"."linea" ("lin_id")
go
COMMENT ON FOREIGN KEY "DBA"."tab_prodotto"."fkey_idlinea" IS
'Riferimento linea'
go
The Alter part of query works well, but I have troubles on COMMENT. I already know that I can alter a column for adding a COMMENT, but is that possible for foreign keys too? If yes, how? I haven’t find nothing special on documentation.
Thank you in advance.
The MySQL reference manual shows the allowed syntax for the
FOREIGN KEYcommand to be:There is no allowable
COMMENTsection. It looks like this is not allowed.The manual I referenced above is from version 5.6. I checked versions 5.1 and 5.5 and the syntax is the same.