Skip to content

fix: quote check constraint names when dropping via column update - #1141

Open
hsusul wants to merge 1 commit into
supabase:masterfrom
hsusul:fix/column-check-drop-constraint-quote
Open

fix: quote check constraint names when dropping via column update#1141
hsusul wants to merge 1 commit into
supabase:masterfrom
hsusul:fix/column-check-drop-constraint-quote

Conversation

@hsusul

@hsusul hsusul commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • Fixes Column update DROP CONSTRAINT fails for hyphenated check names #1140: clearing/changing a column check via columns.update used DROP CONSTRAINT %s, which breaks for hyphenated or otherwise non-plain constraint names (e.g. "t-c-check").
  • Switch to %I so names are identifier-quoted, consistent with unique-constraint drops in the same path.
  • Adds a regression test that creates a hyphenated check and clears it through the columns API.

Test plan

  • npx vitest run test/index.test.ts -t "dropping hyphenated column check|dropping column checks"
  • Confirm Studio / Management API can clear a check whose constraint name contains a hyphen

Hyphenated or otherwise non-plain check names need %I; %s produced
invalid DROP CONSTRAINT SQL on PATCH /columns when clearing checks.
@hsusul
hsusul requested review from a team, avallete and soedirgo as code owners September 4, 2026 15:47
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.

Column update DROP CONSTRAINT fails for hyphenated check names

1 participant