Skip to content

Commit 609e47f

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 3bf4d8a commit 609e47f

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
@@ -894,9 +894,12 @@ func (b *stmtBundleBuilder) addEnv(ctx context.Context) {
894894
for _, addFK := range addFKs {
895895
fmt.Fprintf(&buf, "%s;\n", addFK)
896896
}
897-
// Include FK constraints that were skipped in commented out form.
898-
for _, skipFK := range skipFKs {
899-
fmt.Fprintf(&buf, "-- %s;\n", skipFK)
897+
if len(skipFKs) > 0 {
898+
// Include FK constraints that were skipped in commented out form.
899+
fmt.Fprintf(&buf, "-- NOTE: these FKs are active and are only commented out for ease of bundle recreation.\n--\n")
900+
for _, skipFK := range skipFKs {
901+
fmt.Fprintf(&buf, "-- %s;\n", skipFK)
902+
}
900903
}
901904
}
902905
for i := range views {

0 commit comments

Comments
 (0)