Skip to content

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

fix(frontend): migration history cannot filter by ID as spanner's ID is UUID, use sequence (#4609)

p0nyf5cb889c015e
diff --git a/frontend/src/views/MigrationHistoryDetail.vue b/frontend/src/views/MigrationHistoryDetail.vue
index 5845ab96dd..a12a196133 100644
--- a/frontend/src/views/MigrationHistoryDetail.vue
+++ b/frontend/src/views/MigrationHistoryDetail.vue
@@ -300,7 +300,15 @@ export default defineComponent({
instanceStore.fetchInstanceList();
}
- return migrationHistoryList.filter((mh) => mh.id <= migrationHistoryId);
+ // The returned migration history list has been ordered by `id` DESC or (`namespace` ASC, `sequence` DESC) .
+ // We can obtain prevMigrationHistoryList by cutting up the array by the `migrationHistoryId`.
+ const idx = migrationHistoryList.findIndex(
+ (mh) => mh.id === migrationHistoryId
+ );
+ if (idx === -1) {
+ return [];
+ }
+ return migrationHistoryList.slice(idx);
});
// migrationHistory is the latest migration NOW.