fix: type/extension from different schema#151
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances type qualification for PostgreSQL extension types, custom domains, and enums when they reside in schemas other than the target schema. It addresses GitHub issue #144 and implements the fix in PR #145.
Key Changes
- Added base type (
typtype = 'b') handling in SQL queries to properly qualify extension types likehstoreandcitextwhen they're in external schemas - Modified test infrastructure to execute
setup.sqldirectly to databases instead of concatenating SQL strings - Updated test cases to use extension types from a
utilsschema to verify cross-schema type qualification
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ir/queries/queries.sql.go | Added base type handling to qualify extension types from external schemas |
| testdata/diff/create_table/add_column_custom_type/setup.sql | Updated test setup to create extension types and custom types in utils schema |
| testdata/diff/create_table/add_column_custom_type/new.sql | Modified to use qualified type names from utils schema |
| testdata/diff/create_table/add_column_custom_type/plan.txt | Updated expected plan to reflect qualified type names |
| testdata/diff/create_table/add_column_custom_type/plan.sql | Updated expected DDL with qualified type references |
| testdata/diff/create_table/add_column_custom_type/plan.json | Updated JSON plan with new column definitions and qualified types |
| testdata/diff/create_table/add_column_custom_type/diff.sql | Updated expected diff output with qualified type names |
| internal/diff/diff_test.go | Changed setup handling to execute SQL directly instead of string concatenation |
| cmd/migrate_integration_test.go | Updated to execute setup.sql to both target and embedded databases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
506788e to
2eaa03e
Compare
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.
Fix #144