mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
fix: max revision query order (#4096)
This commit is contained in:
parent
464ef5b326
commit
803610ab82
@ -158,8 +158,11 @@ class EventStore implements IEventStore {
|
|||||||
async getMaxRevisionId(largerThan: number = 0): Promise<number> {
|
async getMaxRevisionId(largerThan: number = 0): Promise<number> {
|
||||||
const row = await this.db(TABLE)
|
const row = await this.db(TABLE)
|
||||||
.max('id')
|
.max('id')
|
||||||
.whereNotNull('feature_name')
|
.where((builder) =>
|
||||||
.orWhere('type', SEGMENT_UPDATED)
|
builder
|
||||||
|
.whereNotNull('feature_name')
|
||||||
|
.orWhere('type', SEGMENT_UPDATED),
|
||||||
|
)
|
||||||
.andWhere('id', '>=', largerThan)
|
.andWhere('id', '>=', largerThan)
|
||||||
.first();
|
.first();
|
||||||
return row ? row.max : -1;
|
return row ? row.max : -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user