Skip to content

Commit cf2c50a

Browse files
misc: update comment
1 parent cad4a97 commit cf2c50a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/adoption/adoption-token.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export class AdoptionToken {
8989
.modify(filterToken(`${ORGS_TABLE}.adoption_token`))
9090
.select(`${ACCOUNTS_TABLE}.id as accountId`, `${ORGS_TABLE}.adoption_token as token`);
9191

92-
// The extracted column inherits the utf8mb4_bin collation of the JSON column, which does not union with the other two.
9392
const extraTokens = this.sql(ACCOUNTS_TABLE)
9493
.join(ORGS_TABLE, `${ACCOUNTS_TABLE}.org`, `${ORGS_TABLE}.id`)
9594
.joinRaw(`, JSON_TABLE(${ORGS_TABLE}.extra_adoption_tokens, '$[*]' COLUMNS (token VARCHAR(255) PATH '$.token')) t`)
@@ -98,6 +97,7 @@ export class AdoptionToken {
9897
query.whereRaw('t.token = ?', [ token ]);
9998
}
10099
})
100+
// Extracted `accountId` column inherits the utf8mb4_bin collation of the JSON column, which does not union with the other two so we need to COLLATE it.
101101
.select(`${ACCOUNTS_TABLE}.id as accountId`, this.sql.raw('t.token COLLATE utf8mb4_unicode_ci as token'));
102102

103103
return userTokens.unionAll([ orgTokens, extraTokens ]) as unknown as Promise<AccountToken[]>;

0 commit comments

Comments
 (0)