Skip to content

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

fix: pass change type (#11831)

p0ny198218ddd740
diff --git a/frontend/src/components/IssueV1/components/SQLCheckSection/SQLCheckSection.vue b/frontend/src/components/IssueV1/components/SQLCheckSection/SQLCheckSection.vue
index d35ddc8435..fccc570a5a 100644
--- a/frontend/src/components/IssueV1/components/SQLCheckSection/SQLCheckSection.vue
+++ b/frontend/src/components/IssueV1/components/SQLCheckSection/SQLCheckSection.vue
@@ -39,13 +39,12 @@
<script lang="ts" setup>
import { computed } from "vue";
import { useTaskSheet } from "@/components/IssueV1/components/StatementSection/useTaskSheet";
-import { useIssueContext, databaseForTask } from "@/components/IssueV1/logic";
+import { useIssueContext, databaseForTask ,specForTask} from "@/components/IssueV1/logic";
import { SQLCheckButton } from "@/components/SQLCheck";
import { TaskTypeListWithStatement } from "@/types";
-import { Task_Type } from "@/types/proto/v1/rollout_service";
+import { Plan_ChangeDatabaseConfig_Type, Task_Type } from "@/types/proto/v1/rollout_service";
import { CheckRequest_ChangeType } from "@/types/proto/v1/sql_service";
import type { Defer } from "@/utils/util";
-import { isGhostEnabledForTask } from "../Sidebar/GhostSection/common";
import OnlineMigrationAdviceExtra from "./OnlineMigrationAdviceExtra.vue";
import SQLCheckBadge from "./SQLCheckBadge.vue";
@@ -83,8 +82,14 @@ const handleToggleOnlineMigration = (on: boolean, confirm: Defer<boolean>) => {
};
const changeType = computed((): CheckRequest_ChangeType | undefined => {
- if (isGhostEnabledForTask(issue.value, selectedTask.value)) {
- return CheckRequest_ChangeType.DDL_GHOST;
+ const spec = specForTask(issue.value.planEntity, selectedTask.value);
+ switch (spec?.changeDatabaseConfig?.type) {
+ case Plan_ChangeDatabaseConfig_Type.MIGRATE:
+ return CheckRequest_ChangeType.DDL;
+ case Plan_ChangeDatabaseConfig_Type.MIGRATE_GHOST:
+ return CheckRequest_ChangeType.DDL_GHOST;
+ case Plan_ChangeDatabaseConfig_Type.DATA:
+ return CheckRequest_ChangeType.DML;
}
return undefined;
});
diff --git a/frontend/src/components/IssueV1/components/Sidebar/GhostSection/common.ts b/frontend/src/components/IssueV1/components/Sidebar/GhostSection/common.ts
index eec6f6a252..9e8704b842 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/GhostSection/common.ts
+++ b/frontend/src/components/IssueV1/components/Sidebar/GhostSection/common.ts
@@ -235,9 +235,3 @@ export const ghostViewTypeForTask = (
}
return "NONE";
};
-
-export const isGhostEnabledForTask = (issue: ComposedIssue, task: Task) => {
- const spec = specForTask(issue.planEntity, task);
- const config = spec?.changeDatabaseConfig;
- return config?.type === Plan_ChangeDatabaseConfig_Type.MIGRATE_GHOST;
-};