Skip to content

Keep the name of a foreign key written inline on its column - #176

Merged
LucaCappelletti94 merged 1 commit into
mainfrom
upstream/inline-fk-name-main
Oct 28, 2026
Merged

LucaCappelletti94 merged 1 commit into
mainfrom
upstream/inline-fk-name-main

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

CREATE TABLE child (parent_id INT CONSTRAINT fk_parent REFERENCES parent (id)) reported a foreign key with no name, while PostgreSQL names it fk_parent and the table-constraint spelling already reads back as fk_parent. sqlparser keeps the name of an inline constraint on the column option and leaves the constraint itself unnamed, and the inline foreign key arm never copied it across, which the inline UNIQUE arm already does.

The same change was merged as #173, but into the stacked base of #172 after #172 had already been squashed into main, so it never reached main.

@LucaCappelletti94 LucaCappelletti94 added the bug Something isn't working label Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LucaCappelletti94
LucaCappelletti94 merged commit 241112a into main Oct 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant