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

fix: EXPOSED-179 Unsigned column check constraint is not unique to table #1860

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

bog-walk
Copy link
Member

If multiple tables have the same unsigned column types with the same column names, creating these tables throws JdbcSQLSyntaxErrorException with a message like Name already used by existing constraint.

Affected databases: H2 (+ compatibility modes), SQL Server, Oracle.

To avoid these naming clashes, the name of the auto-generated check constraint for the unsigned column types now includes the table name in the prefix, with the original column type and name appended to it.

@bog-walk bog-walk requested review from e5l and joc-a September 18, 2023 14:30
@bog-walk bog-walk force-pushed the bog-walk/fix-unsigned-check-constraint branch from 17345fb to 1f74bd3 Compare September 18, 2023 15:06
Auto-generated name for check constraint on unsigned column types was not
including table name, which was problematic if multiple tables used identical
column types with the same name.

The check constraint name now includes the table name, unsigned type, and column
name, which should avoid intra-/inter-table naming exceptions.
@bog-walk bog-walk force-pushed the bog-walk/fix-unsigned-check-constraint branch from 1f74bd3 to 7114268 Compare September 21, 2023 14:04
@bog-walk bog-walk merged commit 9727fb6 into main Sep 21, 2023
4 of 5 checks passed
@bog-walk bog-walk deleted the bog-walk/fix-unsigned-check-constraint branch September 21, 2023 14:39
saral pushed a commit to saral/Exposed that referenced this pull request Oct 3, 2023
…ble (JetBrains#1860)

* fix: EXPOSED-179 Unsigned column check constraint is not unique to table

Auto-generated name for check constraint on unsigned column types was not
including table name, which was problematic if multiple tables used identical
column types with the same name.

The check constraint name now includes the table name, unsigned type, and column
name, which should avoid intra-/inter-table naming exceptions.
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.

3 participants