且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MySQL将注释添加到外键

更新时间:2023-11-30 23:20:28

The MySQL reference manual shows the allowed syntax for the FOREIGN KEY command to be:

  [CONSTRAINT [symbol]] FOREIGN KEY
  [index_name] (index_col_name, ...)
  REFERENCES tbl_name (index_col_name,...)
  [ON DELETE reference_option]
  [ON UPDATE reference_option]

reference_option:
   RESTRICT | CASCADE | SET NULL | NO ACTION

没有允许的 COMMENT 部分.看来这是不允许的.

There is no allowable COMMENT section. It looks like this is not allowed.

我上面引用的手册来自5.6版.我检查了5.1和5.5版本,语法是一样的.

The manual I referenced above is from version 5.6. I checked versions 5.1 and 5.5 and the syntax is the same.