Skip to content

Do not generate FK on non-generated unique constraint #1900

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

Merged

Conversation

fredericDelaporte
Copy link
Member

When an unique key is not generated due to the database not supporting a null value in an unique key, foreign keys on the unique key must not be generated either.

This is an old bug of the feature consisting in not generating unique constraints for nullable columns when the target database does not support null in unique. But as no dialects were enabling this feature, tests were not showcasing it.

#1854 enables a dialect with this feature, and its build fails due to FK being generated for non-generated unique constraints, see here.

@fredericDelaporte
Copy link
Member Author

This PR is also a kind of follow-up to #1855, as the trouble here can happen only when using the feature fixed for another trouble there. It would be better to have that feature (I hope) fully fixed in 5.2.

@fredericDelaporte fredericDelaporte added this to the 5.2 milestone Nov 14, 2018
@fredericDelaporte fredericDelaporte merged commit 8061e2b into nhibernate:master Nov 14, 2018
@fredericDelaporte fredericDelaporte deleted the fk-unique-null branch November 14, 2018 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants