0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor: filter out suspended users in hasActiveUsers()

This commit is contained in:
Gao Sun 2023-02-24 13:17:37 +08:00
parent dd776eeb15
commit 54ef69d4f4
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
2 changed files with 2 additions and 0 deletions

View file

@ -202,6 +202,7 @@ export const createUserQueries = (pool: CommonQueryMethods) => {
pool.exists(sql` pool.exists(sql`
select ${fields.id} select ${fields.id}
from ${table} from ${table}
where ${fields.isSuspended} = false
limit 1 limit 1
`); `);

View file

@ -49,6 +49,7 @@ const alteration: AlterationScript = {
select id select id
from users from users
where tenant_id = 'admin' where tenant_id = 'admin'
and is_suspended = false
limit 1 limit 1
`); `);
await pool.query(sql` await pool.query(sql`