perf: optimize machine token lookup

This commit is contained in:
codex-bot 2025-10-30 16:30:59 -03:00
parent 38b46f32ce
commit 4c848486a6
2 changed files with 17 additions and 14 deletions

View file

@ -379,5 +379,7 @@ export default defineSchema({
})
.index("by_token_hash", ["tokenHash"])
.index("by_machine", ["machineId"])
.index("by_tenant_machine", ["tenantId", "machineId"]),
.index("by_tenant_machine", ["tenantId", "machineId"])
.index("by_machine_created", ["machineId", "createdAt"])
.index("by_machine_revoked_expires", ["machineId", "revoked", "expiresAt"]),
});