Skip to content

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

fix: unwanted error notification when selecting database (#3860)

boojack6668be04f6d1
diff --git a/frontend/src/components/SyncDatabaseSchemaPrepForm.vue b/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
index 2c8cbbf06e..734d549821 100644
--- a/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
+++ b/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
@@ -388,7 +388,10 @@ const hasDiffBetweenCharactorSets = computed(() => {
state.targetDatabaseInfo.databaseId as number
);
- return baseDatabase?.characterSet !== targetDatabase?.characterSet;
+ return (
+ baseDatabase.instance.engine === targetDatabase.instance.engine &&
+ baseDatabase.characterSet !== targetDatabase.characterSet
+ );
});
const databaseMigrationHistoryList = (databaseId: DatabaseId) => {
@@ -587,8 +590,8 @@ watch(
state.targetDatabaseInfo.databaseId as DatabaseId
);
if (
- targetDatabase &&
- targetDatabase.instance.engine !== state.engineType
+ !targetDatabase ||
+ state.engineType !== targetDatabase.instance.engine
) {
state.targetDatabaseInfo.databaseId = undefined;
}
@@ -609,17 +612,22 @@ watch(
const database = databaseStore.getDatabaseById(databaseId as DatabaseId);
state.targetDatabaseInfo.currentSchema = undefined;
- if (database) {
+ if (database && state.engineType === database.instance.engine) {
const currentSchema = await useDatabaseStore().fetchDatabaseSchemaById(
database.id
);
state.targetDatabaseInfo.currentSchema = currentSchema;
+ } else {
+ state.targetDatabaseInfo.databaseId = undefined;
}
}
);
watch(
- () => [shouldShowDiff.value],
+ () => [
+ state.baseSchemaInfo.migrationHistory?.schema,
+ state.targetDatabaseInfo.currentSchema,
+ ],
async () => {
if (shouldShowDiff.value) {
const statement = await getSchemaDiff(