Repository navigation
fix: Quote each column in composite foreign keys - #5821
Merged
marcelomendoncasoares merged 1 commit intoOct 5, 2026
Merged
marcelomendoncasoares merged 1 commit into
marcelomendoncasoares merged 1 commit into
Conversation
The source columns of a foreign key were joined inside one pair of quotes, so a composite key produced invalid SQL. Both the Postgres and SQLite dialects now quote each column, the same way the reference columns are quoted. Fixes serverpod#5735.
Contributor
Author
|
The one failing check is a Windows auth test ( |
marcelomendoncasoares
approved these changes
Oct 5, 2026
marcelomendoncasoares
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this fix, @mackings! 🚀
marcelomendoncasoares
merged commit Oct 5, 2026
c763c4d
into
serverpod:main
958 of 959 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The source columns of a foreign key were joined inside one pair of quotes, so a composite key produced
FOREIGN KEY("tenantId, parentId"), which is invalid SQL. Each column is now quoted on its own, like the reference columns already are.SQLite had the same code, so I fixed it there too. Single-column keys produce the same SQL as before.
Fixes #5735.
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
None.