![](/img/trans.png)
[英]How to name two columns in join tables with two same foreign key at one table in SQL?
[英]How to name SQL FOREIGN KEY Constraint on CREATE two tables columns into a relationship TABLE
我只是想知道是否有一种方法可以在创建表上命名外键
FOREIGN KEY (uuid) REFERENCES employee(uuid));
我试图这样做,并将我的外键命名为fk1,但是语法错误
FOREIGN KEY fk1 (uuid) REFERENCES employee(uuid));
错误
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is com.jda.cloudsql.common.MigrationException: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:
FOREIGN KEY FK1[*] (UUID) REFERENCES EMPLOYEE(UUID)) "; expected "("; SQL statement:
你可以写:
ADD CONSTRAINT `customized_foreign_key_name` FOREIGN KEY (`uuid`) REFERENCES `employee` (`uuid`)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.