fix: Support Retrieval of Cross-Schema Foreign Keys#681
Merged
olavloite merged 1 commit intogoogleapis:mainfrom Jun 20, 2025
Merged
fix: Support Retrieval of Cross-Schema Foreign Keys#681olavloite merged 1 commit intogoogleapis:mainfrom
olavloite merged 1 commit intogoogleapis:mainfrom
Conversation
Allow `get_multi_foreign_keys` to retrieve foreign keys between tables in different schemas. The current SQL used to retrieve them has a mistake in the JOINs used to retrieve them, confusing the `table_schema` column and the `constraint_schema` column. This goes unnoticed as long as everything is in the same schema. Include schemas names in ALTER TABLE schema.table DROP CONSTRAINT DDL and quote the table name. fixes: googleapis#638
9ff2066 to
2593ac7
Compare
Contributor
Author
|
@olavloite would you mind taking a look at this when you have a chance? We're having a bit of trouble from this bug. |
olavloite
approved these changes
Jun 20, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BEGIN_COMMIT_OVERRIDE
fix: support retrieval of cross-schema foreign keys
Allow
get_multi_foreign_keysto retrieve foreign keys between tables in different schemas. The current SQL used to retrieve them has a mistake in the JOINs, confusing thetable_schemacolumn and theconstraint_schemacolumn. This goes unnoticed as long as everything is in the same schema.Include schema names in
ALTER TABLE schema.table DROP CONSTRAINT fk_constraintDDL and quote the table name.fixes: #638
END_COMMIT_OVERRIDE