Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Use a separate copy of the columnList if adding the extra SQL console column

天舟4e856ac7bd98
diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vue
index 23df26b8fe..06240a617c 100644
--- a/frontend/src/components/DatabaseTable.vue
+++ b/frontend/src/components/DatabaseTable.vue
@@ -95,7 +95,7 @@ import { useRouter } from "vue-router";
import { consoleLink, databaseSlug, isDBAOrOwner } from "../utils";
import { Database } from "../types";
import { BBTableColumn } from "../bbkit/types";
-import { isEmpty } from "lodash";
+import { cloneDeep, isEmpty } from "lodash";
type Mode = "ALL" | "ALL_SHORT" | "INSTANCE" | "PROJECT" | "PROJECT_SHORT";
@@ -319,6 +319,8 @@ export default {
list = columnListMap.get(props.mode)!;
}
if (showConsoleLink.value) {
+ // Use cloneDeep, otherwise it will alter the one in columnListMap
+ list = cloneDeep(list);
list.push({ title: "SQL console" });
}
return list;