Skip to content

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

fix: sync schema show more button (#7436)

ecmadaoc9850ecc6b18
diff --git a/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue b/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue
index de1b689f78..acbdd53400 100644
--- a/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue
+++ b/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue
@@ -89,15 +89,6 @@
</span>
</div>
</template>
- <template v-if="shouldShowMoreVersionButton" #suffixItem>
- <div
- class="w-full flex flex-row justify-start items-center pl-3 leading-8 text-accent cursor-pointer hover:opacity-80"
- @click.prevent.capture="() => (state.showFeatureModal = true)"
- >
- <heroicons-solid:sparkles class="w-4 h-auto mr-1" />
- {{ $t("database.sync-schema.more-version") }}
- </div>
- </template>
</BBSelect>
</div>
</div>
@@ -170,13 +161,6 @@ const hasSyncSchemaFeature = computed(() => {
);
});
-const shouldShowMoreVersionButton = computed(() => {
- return (
- !hasSyncSchemaFeature.value &&
- databaseChangeHistoryList(state.databaseId as string).length > 0
- );
-});
-
const prepareChangeHistoryList = async () => {
if (!database.value) {
return;
@@ -286,6 +270,13 @@ const databaseChangeHistoryList = (databaseId: string) => {
};
const handleSchemaVersionSelect = (changeHistory: ChangeHistory) => {
+ const index = databaseChangeHistoryList(state.databaseId as string).findIndex(
+ (history) => history.uid === changeHistory.uid
+ );
+ if (index > 0 && !hasSyncSchemaFeature.value) {
+ state.showFeatureModal = true;
+ return;
+ }
state.changeHistory = changeHistory;
};