Skip to content

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

feat: add troubleshoot link beside PG migration error (#9876)

Tianzhou (天舟)8dd43c6d5098
diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
index 1b59843a24..c1d6382aee 100644
--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
@@ -2,19 +2,31 @@
{{ comment }}
<template v-if="commentLink.link">
- <router-link
- class="bb-comment-link ml-1 normal-link"
- :to="commentLink.link"
- >
- {{ commentLink.title }}
- </router-link>
+ <template v-if="commentLink.link.startsWith('/')">
+ <router-link
+ class="bb-comment-link ml-1 normal-link"
+ :to="commentLink.link"
+ >
+ {{ commentLink.title }}
+ </router-link>
+ </template>
+ <template v-else>
+ <a
+ class="bb-comment-link ml-1 normal-link"
+ :href="commentLink.link"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ {{ commentLink.title }}
+ </a>
+ </template>
</template>
</template>
<script setup lang="ts">
import { computed } from "vue";
import { useI18n } from "vue-i18n";
-import { unknownTask } from "@/types";
+import { unknownTask, isPostgresFamily } from "@/types";
import {
TaskRun,
TaskRun_ExecutionStatus,
@@ -151,6 +163,13 @@ const commentLink = computed((): CommentLink => {
// link: `/db/${databaseSlug(task.database!)}#change-history`,
// };
// }
+ const db = databaseForTask(issue.value, task);
+ if (isPostgresFamily(db.instanceEntity.engine)) {
+ return {
+ title: t("common.troubleshoot"),
+ link: "https://www.bytebase.com/docs/change-database/troubleshoot/#postgresql",
+ };
+ }
}
return {
title: "",
diff --git a/frontend/src/types/instance.ts b/frontend/src/types/instance.ts
index 46f494b49e..4c2d7aad72 100644
--- a/frontend/src/types/instance.ts
+++ b/frontend/src/types/instance.ts
@@ -61,6 +61,14 @@ export function convertEngineType(type: EngineType): Engine {
return Engine.ENGINE_UNSPECIFIED;
}
+export function isPostgresFamily(type: Engine): boolean {
+ return (
+ type == Engine.POSTGRES ||
+ type == Engine.REDSHIFT ||
+ type == Engine.RISINGWAVE
+ );
+}
+
export function defaultCharset(type: EngineType): string {
switch (type) {
case "CLICKHOUSE":