Preserve machine identity based on hardware

- Add by_tenant_hostname index for hostname-based lookup
- Add third search in register mutation for hardware matching
- Search by hostname + MAC/serial when fingerprint/email differ
- Fallback to MAC/serial match across all tenant machines
- Preserves ticket history when user changes on same physical machine

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
rever-tecnologia 2025-12-05 17:00:19 -03:00
parent 376e81c9c7
commit bb82efa9d3
2 changed files with 37 additions and 0 deletions

View file

@ -647,6 +647,7 @@ export default defineSchema({
.index("by_tenant_company", ["tenantId", "companyId"])
.index("by_tenant_fingerprint", ["tenantId", "fingerprint"])
.index("by_tenant_assigned_email", ["tenantId", "assignedUserEmail"])
.index("by_tenant_hostname", ["tenantId", "hostname"])
.index("by_auth_email", ["authEmail"]),
usbPolicyEvents: defineTable({