Skip to content

Commit 120adcf

Browse files
committed
Fix error in assets/apps SQL query
1 parent 9f5b543 commit 120adcf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

idb/postgres/postgres.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,12 +1992,12 @@ func (db *IndexerDb) Assets(ctx context.Context, filter idb.AssetsQuery) (<-chan
19921992
whereArgs := make([]interface{}, 0, maxWhereParts)
19931993
partNumber := 1
19941994
if filter.AssetID != nil {
1995-
whereParts = append(whereParts, fmt.Sprintf("a.index = $%d", partNumber))
1995+
whereParts = append(whereParts, fmt.Sprintf("a.id = $%d", partNumber))
19961996
whereArgs = append(whereArgs, *filter.AssetID)
19971997
partNumber++
19981998
}
19991999
if filter.AssetIDGreaterThan != nil {
2000-
whereParts = append(whereParts, fmt.Sprintf("a.index > $%d", partNumber))
2000+
whereParts = append(whereParts, fmt.Sprintf("a.id > $%d", partNumber))
20012001
whereArgs = append(whereArgs, *filter.AssetIDGreaterThan)
20022002
partNumber++
20032003
}
@@ -2248,7 +2248,7 @@ func (db *IndexerDb) Applications(ctx context.Context, filter idb.ApplicationQue
22482248
whereArgs := make([]interface{}, 0, maxWhereParts)
22492249
partNumber := 1
22502250
if filter.ApplicationID != nil {
2251-
whereParts = append(whereParts, fmt.Sprintf("index = $%d", partNumber))
2251+
whereParts = append(whereParts, fmt.Sprintf("id = $%d", partNumber))
22522252
whereArgs = append(whereArgs, *filter.ApplicationID)
22532253
partNumber++
22542254
}
@@ -2258,7 +2258,7 @@ func (db *IndexerDb) Applications(ctx context.Context, filter idb.ApplicationQue
22582258
partNumber++
22592259
}
22602260
if filter.ApplicationIDGreaterThan != nil {
2261-
whereParts = append(whereParts, fmt.Sprintf("index > $%d", partNumber))
2261+
whereParts = append(whereParts, fmt.Sprintf("id > $%d", partNumber))
22622262
whereArgs = append(whereArgs, *filter.ApplicationIDGreaterThan)
22632263
partNumber++
22642264
}

0 commit comments

Comments
 (0)