Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly specify constraint name in create table statement #570

Merged
merged 1 commit into from
May 29, 2019
Merged

Explicitly specify constraint name in create table statement #570

merged 1 commit into from
May 29, 2019

Conversation

apprme
Copy link

@apprme apprme commented May 27, 2019

Exposed uses ALTER TABLE statements to create constraints in case when there are cycles in table structure. In this case it explicitly sets constraint name to fk_${fromCol.table.tableName}_${fromCol.name}_${targetColumn.name}. However, if there are no cycles, constraints are defined in CREATE TABLE statements without name specification: thus, their names are generated by database engine that uses different naming convention (ie Table_ibfk_1 in innodb).

This patch makes Exposed to explicitly specify constraint names in CREATE TABLE statements.

It also sets identifierLengthLimit for MySQL to 64 (as specified here) to fix test that fails otherwise.

@Tapac
Copy link
Contributor

Tapac commented May 29, 2019

Thank you for your PR, could you please check tests in spring-transaction module?
They start to fail on our CI-server and other tests can't start because of this (https://teamcity.jetbrains.com/viewType.html?buildTypeId=Exposed_PullRequests&branch_Exposed=570%2Fmerge&tab=buildTypeStatusDiv)

@Tapac Tapac self-requested a review May 29, 2019 12:33
@apprme
Copy link
Author

apprme commented May 29, 2019

apparently it was a missing space character here

sorry for that.

@Tapac Tapac merged commit ef863c9 into JetBrains:master May 29, 2019
@Tapac Tapac added this to the 0.14.1 milestone Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants