Jira issue originally created by user @beberlei:
This issue is created automatically through a Github pull request on behalf of klaussilveira:
When creating a schema with tables with reserved names and relationships between them, the schema creation tool failed to write valid SQL in MySQL due to unquoted table names. For example:
CREATE TABLE `Group` (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL DEFAULT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE User (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE UserHasGroup (user*id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_617A865CA76ED395 (user_id), INDEX IDX_617A865CFE54D947 (group_id), PRIMARY KEY(user_id, group*id)) ENGINE = InnoDB;
ALTER TABLE UserHasGroup ADD CONSTRAINT FK*617A865CA76ED395 FOREIGN KEY (user*id) REFERENCES User (id);
ALTER TABLE UserHasGroup ADD CONSTRAINT FK*617A865CFE54D947 FOREIGN KEY (group*id) REFERENCES Group (id);
This fix creates a small function for creating quoted foreign key table names.
Comment created by @beberlei:
A related Github Pull-Request [GH-166] was closed
Issue was closed with resolution "Fixed"