开发者

MySql Alter Syntax error with mulitple FK

If i do the first one i have no problem. When i do addition i get a syntax error. What is wrong with the syntax? The error says syntax error near [entire 2nd line]

alter table `ban_Status` add FOREIGN KEY (`banned_user`) REFE开发者_Python百科RENCES `user_data`(`id`)


alter table `ban_Status` add FOREIGN KEY (`banned_user`) REFERENCES `user_data`(`id`),
FOREIGN KEY (`banning_user`) REFERENCES `user_data`(`id`),
FOREIGN KEY (`unban_user`) REFERENCES `user_data`(`id`)


I think you need "add" before lines 2 and 3. That or you need to name your constraints.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜