Skip to content

Commit 210e420

Browse files
committed
sql: add comment about skipped FKs
We just made a change to include skipped FKs (those that we deemed "irrelevant") in the commented out form. This commit improves that logic by adding a comment for why these FKs are commented out, to reduce possible confusion. Release note: None
1 parent 795fd85 commit 210e420

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/sql/explain_bundle.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,12 @@ func (b *stmtBundleBuilder) addEnv(ctx context.Context) {
880880
for _, addFK := range addFKs {
881881
fmt.Fprintf(&buf, "%s;\n", addFK)
882882
}
883-
// Include FK constraints that were skipped in commented out form.
884-
for _, skipFK := range skipFKs {
885-
fmt.Fprintf(&buf, "-- %s;\n", skipFK)
883+
if len(skipFKs) > 0 {
884+
// Include FK constraints that were skipped in commented out form.
885+
fmt.Fprintf(&buf, "-- NOTE: these FKs are active and are only commented out for ease of bundle recreation.\n--\n")
886+
for _, skipFK := range skipFKs {
887+
fmt.Fprintf(&buf, "-- %s;\n", skipFK)
888+
}
886889
}
887890
}
888891
for i := range views {

0 commit comments

Comments
 (0)