Skip to content

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

chore: mode=tenant to batch=1 (#9118)

Liu Ji2774e9210689
diff --git a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
index ab66443dbf..9267259cc7 100644
--- a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
@@ -809,7 +809,7 @@ const generateTenant = async () => {
const query: Record<string, any> = {
template: props.type,
project: state.project.uid,
- mode: "tenant",
+ batch: "1",
};
if (state.alterType === "TENANT") {
const databaseList = databaseV1Store.databaseListByProject(
diff --git a/frontend/src/components/AlterSchemaPrepForm/GhostDialog.vue b/frontend/src/components/AlterSchemaPrepForm/GhostDialog.vue
deleted file mode 100644
index fe76a2e563..0000000000
--- a/frontend/src/components/AlterSchemaPrepForm/GhostDialog.vue
+++ /dev/null
@@ -1,117 +0,0 @@
-<template>
- <BBDialog
- ref="dialog"
- :title="$t('issue.migration-mode.title')"
- :positive-text="$t('common.next')"
- :on-before-positive-click="checkFeature"
- data-label="bb-migration-mode-dialog"
- >
- <div class="w-[28rem] space-y-4 pl-8 pr-2 pb-4">
- <div class="flex items-start space-x-2">
- <input
- v-model="state.mode"
- tabindex="-1"
- type="radio"
- class="text-accent disabled:text-accent-disabled focus:ring-accent mt-0.5"
- value="normal"
- />
- <div @click="state.mode = 'normal'">
- <div class="textlabel">
- {{ $t("issue.migration-mode.normal.title") }}
- </div>
- <div class="textinfolabel mt-1">
- <i18n-t tag="p" keypath="issue.migration-mode.normal.description" />
- </div>
- </div>
- </div>
- <div class="flex items-start space-x-2">
- <input
- v-model="state.mode"
- tabindex="-1"
- type="radio"
- class="text-accent disabled:text-accent-disabled focus:ring-accent mt-0.5"
- value="online"
- />
- <div @click="state.mode = 'online'">
- <div class="textlabel flex items-center space-x-2">
- <span>{{ $t("issue.migration-mode.online.title") }}</span>
- <FeatureBadge feature="bb.feature.online-migration" />
- <BBBetaBadge />
- </div>
- <div class="textinfolabel mt-1">
- <i18n-t tag="p" keypath="issue.migration-mode.online.description">
- <template #link>
- <LearnMoreLink
- url="https://www.bytebase.com/docs/change-database/online-schema-migration-for-mysql"
- />
- </template>
- </i18n-t>
- </div>
- </div>
- </div>
- </div>
- </BBDialog>
-
- <FeatureModal
- feature="bb.feature.online-migration"
- :open="state.showFeatureModal"
- @cancel="state.showFeatureModal = false"
- />
-</template>
-
-<script lang="ts" setup>
-import { reactive, ref } from "vue";
-import { BBDialog } from "@/bbkit";
-import { featureToRef } from "@/store";
-import LearnMoreLink from "../LearnMoreLink.vue";
-
-type Mode = "normal" | "online";
-
-type LocalState = {
- mode: Mode;
- showFeatureModal: boolean;
-};
-
-const dialog = ref<InstanceType<typeof BBDialog> | null>(null);
-
-const state = reactive<LocalState>({
- mode: "normal",
- showFeatureModal: false,
-});
-
-const hasGhostFeature = featureToRef("bb.feature.online-migration");
-
-const checkFeature = (): boolean => {
- if (state.mode === "normal") {
- // Don't block anything when selecting normal migration
- return true;
- }
-
- if (!hasGhostFeature.value) {
- state.showFeatureModal = true;
- return false;
- }
- return true;
-};
-
-const open = (): Promise<{ result: boolean; mode: Mode }> => {
- state.mode = "normal"; // reset state
-
- return dialog.value!.open().then(
- (result) => {
- return {
- result,
- mode: state.mode,
- };
- },
- (_error) => {
- return {
- result: false,
- mode: "normal",
- };
- }
- );
-};
-
-defineExpose({ open });
-</script>
diff --git a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue
index c9fb91e6d4..a327a1b944 100644
--- a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue
@@ -412,14 +412,12 @@ const handlePreviewIssue = async () => {
const query: Record<string, any> = {
template: "bb.issue.database.schema.update",
project: project.value.uid,
- mode: "normal",
- ghost: undefined,
};
if (isTenantProject.value) {
if (props.databaseIdList.length > 1) {
// A tenant pipeline with 2 or more databases will be generated
// via deployment config, so we don't need the databaseList parameter.
- query.mode = "tenant";
+ query.batch = "1";
} else {
// A tenant pipeline with only 1 database will be downgraded to
// a standard pipeline.
diff --git a/frontend/src/components/IssueV1/logic/base.ts b/frontend/src/components/IssueV1/logic/base.ts
index 85784ee59d..a16c58d70e 100644
--- a/frontend/src/components/IssueV1/logic/base.ts
+++ b/frontend/src/components/IssueV1/logic/base.ts
@@ -165,7 +165,7 @@ export const useBaseIssueContext = (
});
const isTenantMode = computed((): boolean => {
// To sync databases schema in tenant mode, we use normal project logic to create issue.
- if (isCreating.value && route.query.mode !== "tenant") return false;
+ if (isCreating.value && route.query.batch !== "1") return false;
if (project.value.tenantMode !== TenantMode.TENANT_MODE_ENABLED)
return false;
diff --git a/frontend/src/components/IssueV1/logic/initialize/create.ts b/frontend/src/components/IssueV1/logic/initialize/create.ts
index e0f87cddb5..2c21199cc0 100644
--- a/frontend/src/components/IssueV1/logic/initialize/create.ts
+++ b/frontend/src/components/IssueV1/logic/initialize/create.ts
@@ -128,7 +128,7 @@ export const buildPlan = async (params: CreateIssueParams) => {
query.changelist,
params
);
- } else if (query.mode === "tenant") {
+ } else if (query.batch === "1") {
// in tenant mode, all specs share a unique sheet
const sheetUID = nextUID();
// build tenant plan
diff --git a/frontend/src/utils/databaseGroup/issue.ts b/frontend/src/utils/databaseGroup/issue.ts
index f7b4ba4f07..46c2487c2c 100644
--- a/frontend/src/utils/databaseGroup/issue.ts
+++ b/frontend/src/utils/databaseGroup/issue.ts
@@ -17,7 +17,7 @@ export const generateDatabaseGroupIssueRoute = (
const query: Record<string, any> = {
template: type,
- mode: "tenant",
+ batch: "1",
name: issueNameParts.join(" "),
project: databaseGroup.project.uid,
databaseGroupName: databaseGroup.name,