From 4dfde8580210810f33f58f5234295a11f78d5ab2 Mon Sep 17 00:00:00 2001 From: Mohammed Affan Date: Mon, 14 Oct 2024 14:54:43 -0400 Subject: [PATCH] [OTE-863] update username generation query (#2482) --- .../postgres/src/stores/subaccount-usernames-table.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indexer/packages/postgres/src/stores/subaccount-usernames-table.ts b/indexer/packages/postgres/src/stores/subaccount-usernames-table.ts index a60b1c6da8..72a894ce58 100644 --- a/indexer/packages/postgres/src/stores/subaccount-usernames-table.ts +++ b/indexer/packages/postgres/src/stores/subaccount-usernames-table.ts @@ -103,10 +103,9 @@ export async function getSubaccountsWithoutUsernames( const queryString: string = ` SELECT id as "subaccountId" FROM subaccounts - WHERE id NOT IN ( - SELECT "subaccountId" FROM subaccount_usernames - ) - AND subaccounts."subaccountNumber"=0 + WHERE subaccounts."subaccountNumber" = 0 + EXCEPT + SELECT "subaccountId" FROM subaccount_usernames; `; const result: {