Skip to content

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

fix: swap the display between base and target schema (#2767)

Danny Xu865e7c0a4e2e
diff --git a/frontend/src/components/SyncDatabaseSchemaPrepForm.vue b/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
index 8d8ad2ba9f..c8e2f10492 100644
--- a/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
+++ b/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
@@ -195,8 +195,8 @@
<code-diff
v-else
class="w-full"
- :old-string="state.baseSchemaInfo.migrationHistory?.schema ?? ''"
- :new-string="targetDatabaseLatestMigrationHistory?.schema"
+ :old-string="targetDatabaseLatestMigrationHistory?.schema"
+ :new-string="state.baseSchemaInfo.migrationHistory?.schema ?? ''"
output-format="side-by-side"
data-label="bb-migration-history-code-diff-block"
/>
@@ -388,8 +388,10 @@ const handleNextButtonClick = async () => {
state.currentStep = 1;
const schema = await getSchemaDiff(
state.engineType as EngineType,
- state.baseSchemaInfo.migrationHistory?.schema ?? "",
- targetDatabaseLatestMigrationHistory.value?.schema ?? ""
+ targetDatabaseLatestMigrationHistory.value?.schema ??
+ "" /* the current schema of the database to be updated */,
+ state.baseSchemaInfo.migrationHistory?.schema ??
+ "" /* the schema to be updated to */
);
state.recommandStatement = schema;
state.editStatement = schema;