diff --git a/src/lib/db/event-store.ts b/src/lib/db/event-store.ts index e4b55e317d..7af1977027 100644 --- a/src/lib/db/event-store.ts +++ b/src/lib/db/event-store.ts @@ -158,8 +158,11 @@ class EventStore implements IEventStore { async getMaxRevisionId(largerThan: number = 0): Promise { const row = await this.db(TABLE) .max('id') - .whereNotNull('feature_name') - .orWhere('type', SEGMENT_UPDATED) + .where((builder) => + builder + .whereNotNull('feature_name') + .orWhere('type', SEGMENT_UPDATED), + ) .andWhere('id', '>=', largerThan) .first(); return row ? row.max : -1;