clean users table
This commit is contained in:
parent
7af841c330
commit
be6f48427f
2 changed files with 6 additions and 1 deletions
|
|
@ -183,11 +183,12 @@ export default class {
|
|||
await this.storage.offerStorage.DeleteUserOffers(appUserId, tx)
|
||||
await this.storage.debitStorage.RemoveUserDebitAccess(appUserId, tx)
|
||||
await this.storage.applicationStorage.RemoveAppUserDevices(appUserId, tx)
|
||||
|
||||
}
|
||||
await this.storage.paymentStorage.RemoveUserInvoices(userId, tx)
|
||||
await this.storage.productStorage.RemoveUserProducts(userId, tx)
|
||||
await this.storage.paymentStorage.RemoveUserEphemeralKeys(userId, tx)
|
||||
await this.storage.userStorage.DeleteUserAccess(userId, tx)
|
||||
await this.storage.applicationStorage.RemoveAppUsersAndBaseUsers(appUserIds, userId, tx)
|
||||
})
|
||||
}
|
||||
this.log("Cleaned up inactive users")
|
||||
|
|
|
|||
|
|
@ -126,4 +126,8 @@ export default class {
|
|||
const lastSeenAtUnix = now - seconds
|
||||
return this.dbs.Find<UserAccess>('UserAccess', { where: { last_seen_at_unix: LessThan(lastSeenAtUnix) } })
|
||||
}
|
||||
|
||||
async DeleteUserAccess(userId: string, txId?: string) {
|
||||
return this.dbs.Delete<UserAccess>('UserAccess', { user_id: userId }, txId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue