Skip to content

Comments

chore: fix materialized view recreate summary#189

Merged
tianzhou merged 1 commit intomainfrom
summary
Dec 3, 2025
Merged

chore: fix materialized view recreate summary#189
tianzhou merged 1 commit intomainfrom
summary

Conversation

@tianzhou
Copy link
Contributor

@tianzhou tianzhou commented Dec 3, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 3, 2025 07:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the summary display for materialized views that are recreated due to table dependencies. Previously, such views were incorrectly counted as "adds" when they should be counted as "modifications" since the view existed before and is being recreated.

  • Introduces a new DiffOperationRecreate operation to distinguish DROP operations that are part of a DROP+CREATE cycle
  • Updates plan summary logic to treat recreate operations as modifications rather than additions
  • Ensures consistent display across both the plan summary counts and the detailed change list

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
testdata/diff/dependency/table_to_materialized_view/plan.txt Test data showing expected output where recreated materialized view is now correctly shown as "2 to modify" instead of "1 to add, 1 to modify"
internal/diff/diff.go Adds DiffOperationRecreate enum value and uses it in generatePreDropMaterializedViewsSQL to mark views that will be recreated
internal/plan/plan.go Updates summary calculation and display logic to track recreate operations and convert subsequent create operations to modifications

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou merged commit 8b05e5a into main Dec 3, 2025
2 checks passed
@tianzhou tianzhou deleted the summary branch December 5, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant