Skip to content

Commit 808a0a4

Browse files
fix(adoption-insights): fix subquery alias in total_users endpoint to support older PG versions (#608)
1 parent 6eecbea commit 808a0a4

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-adoption-insights-backend': patch
3+
---
4+
5+
fix subquery alias in total_users endpoint

workspaces/adoption-insights/plugins/adoption-insights-backend/src/database/adapters/BaseAdapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ export abstract class BaseDatabaseAdapter implements EventDatabase {
149149
db('events')
150150
.select('user_ref')
151151
.whereBetween('created_at', [start_date, end_date])
152-
.groupBy('user_ref'),
153-
)
154-
.as('sub');
152+
.groupBy('user_ref')
153+
.as('sub'),
154+
);
155155

156156
return query.then(result => {
157157
const { licensedUsers } = this.config!;

0 commit comments

Comments
 (0)