Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for materialized view indexes to pgschema, addressing issue #66. The implementation enables creating, modifying, and dropping indexes on materialized views with both offline and online migration strategies.
Key changes:
- Extended the View struct to include an Indexes field for materialized views
- Added index support throughout the parser, differ, and plan generation pipeline
- Implemented proper categorization and handling of view index operations in migration plans
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/dump/sakila/pgschema.sql | Added sample materialized view index creation |
| testdata/diff/online/alter_materialized_view_index/* | Test data for online index modification scenarios |
| testdata/diff/online/add_materialized_view_index/* | Test data for adding indexes to materialized views |
| testdata/diff/create_materialized_view/alter_materialized_view/* | Updated test to reflect new plan output format |
| testdata/diff/create_index/drop_index/* | Extended test to include view index operations |
| testdata/diff/comment_on/add_index_comment/* | Added materialized view index comment scenarios |
| ir/parser.go | Enhanced parser to handle indexes on materialized views |
| ir/ir.go | Added Indexes field to View struct for materialized views |
| ir/inspector.go | Modified index building to support materialized views |
| internal/plan/rewrite.go | Added view index rewrite support for online operations |
| internal/plan/plan.go | Enhanced plan generation to handle view operations and sub-resources |
| internal/diff/view.go | Implemented view index diffing and SQL generation |
| internal/diff/index.go | Refactored index creation to support both tables and views |
| internal/diff/diff.go | Added new diff types for view indexes and enhanced view diffing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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 #66