-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
schemadiff
: consistent key ordering in table diff
#17141
schemadiff
: consistent key ordering in table diff
#17141
Conversation
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
@@ -280,8 +280,8 @@ func (d *SchemaDiff) UnorderedDiffs() []EntityDiff { | |||
return d.diffs | |||
} | |||
|
|||
// AllDependenciess returns all known dependencies | |||
func (d *SchemaDiff) AllDependenciess() (deps []*DiffDependency) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just typo fix
for _, t1Key := range t1Keys { | ||
if stmt, ok := dropKeyStatements[t1Key.Info.Name.String()]; ok { | ||
alterTable.AlterOptions = append(alterTable.AlterOptions, stmt) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent ordering iteration
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17141 +/- ##
=======================================
Coverage 67.44% 67.44%
=======================================
Files 1569 1569
Lines 252119 252120 +1
=======================================
+ Hits 170038 170043 +5
+ Misses 82081 82077 -4 ☔ View full report in Codecov by Sentry. |
Description
When diffing tables, produce
DROP KEY
statements in consistent order, and compatible with the order of keys defined in the original table.I've done an exhaustive search to validate this is the only indeterministic output in a table diff.
Related Issue(s)
Fixes #17140
Checklist
Deployment Notes