Skip to content

Commit

Permalink
chore: use joins instead of left joins
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Sep 26, 2024
1 parent 823f633 commit 2a5b8e3
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ export class PersonalDashboardReadModel implements IPersonalDashboardReadModel {
}>('projects')
.join('role_user', 'projects.id', 'role_user.project')
.join('roles', 'role_user.role_id', 'roles.id')
.leftJoin('group_user', (join) => {
.join('group_user', (join) => {
join.on('group_user.user_id', '=', this.db.raw('?', [userId]));
})
.leftJoin(
'group_role',
'group_role.group_id',
'group_user.group_id',
)
.leftJoin(
.join('group_role', 'group_role.group_id', 'group_user.group_id')
.join(
'roles as group_roles',
'group_role.role_id',
'group_roles.id',
Expand Down

0 comments on commit 2a5b8e3

Please sign in to comment.