[英]How to name SQL FOREIGN KEY Constraint on CREATE two tables columns into a relationship TABLE
i was just wondering if there is a way to name a foreign key on create table 我只是想知道是否有一种方法可以在创建表上命名外键
FOREIGN KEY (uuid) REFERENCES employee(uuid));
i tried to do this and name my foreign key as fk1 but i've got syntax errors 我试图这样做,并将我的外键命名为fk1,但是语法错误
FOREIGN KEY fk1 (uuid) REFERENCES employee(uuid));
error 错误
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.