Skip to content

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

chore: skip db schema cache in database detail page (#4080)

boojack85d95fcc805d
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 0c9cb35c7e..9306e76559 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -1238,43 +1238,45 @@ router.beforeEach((to, from, next) => {
databaseStore
.fetchDatabaseById(idFromSlug(databaseSlug))
.then((database: Database) => {
- dbSchemaStore.getOrFetchDatabaseMetadataById(database.id).then(() => {
- if (!dataSourceSlug && !migrationHistorySlug) {
- next();
- } else if (dataSourceSlug) {
- useDataSourceStore()
- .fetchDataSourceById({
- dataSourceId: idFromSlug(dataSourceSlug),
- databaseId: database.id,
- })
- .then(() => {
- next();
- })
- .catch((error) => {
- next({
- name: "error.404",
- replace: false,
+ dbSchemaStore
+ .getOrFetchDatabaseMetadataById(database.id, true)
+ .then(() => {
+ if (!dataSourceSlug && !migrationHistorySlug) {
+ next();
+ } else if (dataSourceSlug) {
+ useDataSourceStore()
+ .fetchDataSourceById({
+ dataSourceId: idFromSlug(dataSourceSlug),
+ databaseId: database.id,
+ })
+ .then(() => {
+ next();
+ })
+ .catch((error) => {
+ next({
+ name: "error.404",
+ replace: false,
+ });
+ throw error;
});
- throw error;
- });
- } else if (migrationHistorySlug) {
- instanceStore
- .fetchMigrationHistoryById({
- instanceId: database.instance.id,
- migrationHistoryId: idFromSlug(migrationHistorySlug),
- })
- .then(() => {
- next();
- })
- .catch((error) => {
- next({
- name: "error.404",
- replace: false,
+ } else if (migrationHistorySlug) {
+ instanceStore
+ .fetchMigrationHistoryById({
+ instanceId: database.instance.id,
+ migrationHistoryId: idFromSlug(migrationHistorySlug),
+ })
+ .then(() => {
+ next();
+ })
+ .catch((error) => {
+ next({
+ name: "error.404",
+ replace: false,
+ });
+ throw error;
});
- throw error;
- });
- }
- });
+ }
+ });
})
.catch((error) => {
next({
diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vue
index 8960c87db1..895bcbc787 100644
--- a/frontend/src/views/DatabaseDetail.vue
+++ b/frontend/src/views/DatabaseDetail.vue
@@ -397,12 +397,12 @@ const props = defineProps({
},
});
+const { t } = useI18n();
+const router = useRouter();
const databaseStore = useDatabaseStore();
const repositoryStore = useRepositoryStore();
const dbSchemaStore = useDBSchemaStore();
const sqlStore = useSQLStore();
-const router = useRouter();
-const { t } = useI18n();
const ghostDialog = ref<InstanceType<typeof GhostDialog>>();
const databaseTabItemList: DatabaseTabItem[] = [