开发者

MySql Alter Syntax error with mulitple FK

开发者 https://www.devze.com 2022-12-31 22:10 出处:网络
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]

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

精彩评论

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