You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->
#### Summary
This PR fixes the table diff logic to support PK changes. For example
#5636 (comment)
is wrong.
<!--
Use the following steps to ensure your PR is ready to be reviewed
- [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md)
🧑🎓
- [ ] Test locally on your own infrastructure
- [ ] Run `go fmt` to format your code 🖊
- [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint
[here](https://golangci-lint.run/usage/install/#local-installation))
- [ ] Update or add tests 🧪
- [ ] Ensure the status checks below are successful ✅
--->
Text: fmt.Sprintf("Table %s: column type changed from %s to %s for %s", backtickStrings(table, deletedDataType, addedDataType, deletedName)...),
66
-
Breaking: true,
72
+
Text: fmt.Sprintf("Table %s: column order changed for %s", backtickStrings(table, deletedName)...),
73
+
Breaking: false,
67
74
})
68
-
} else {
75
+
continue
76
+
}
77
+
78
+
ifaddedColumn.dataType!=deletedColumn.dataType {
69
79
changes=append(changes, change{
70
-
Text: fmt.Sprintf("Table %s: column order changed for %s", backtickStrings(table, deletedName)...),
80
+
Text: fmt.Sprintf("Table %s: column type changed from %s to %s for %s", backtickStrings(table, deletedColumn.dataType, addedColumn.dataType, deletedName)...),
{name: "Should parse name and data type when change is a column", args: args{line: "|name|String|"}, wantName: "name", wantDataType: "String"},
37
+
{name: "Should parse name, pk and data type when a column is a primary key", args: args{line: "|name (PK)|String|"}, wantName: "name", wantDataType: "String", wantPk: true},
36
38
{name: "Should return empty strings when change is not a column", args: args{line: "# Table: azure_appservice_site_auth_settings"}, wantName: "", wantDataType: ""},
0 commit comments