You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 21, 2026. It is now read-only.
fix(auth): Handle CockroachDB BIGINT IDs as strings to prevent precision loss
When migrating from MSSQL to CockroachDB, user IDs changed from sequential
INT to distributed BIGINT values generated via unique_rowid(). ColdFusion's
double precision cannot safely represent all 64-bit integers, causing silent
ID corruption that manifested as:
- Empty user_id in token records after registration
- Random "user not found" errors
- Token verification failures
Changes:
- User.cfc: Set id and roleId properties to datatype="string"
- UserToken.cfc: Set id and user_id properties to datatype="string"
- AuthController.saveUser(): Add ID retrieval fallback and extensive logging
to debug Wheels ID population with CockroachDB
This ensures BIGINT IDs are treated as opaque string identifiers throughout
the application layer while remaining INT8 in the database. PostgreSQL/
CockroachDB automatically handle string-to-BIGINT conversion in queries.
Fixes user registration flow where tokens were being created with empty
user_id values.
// Tell Wheels to treat the ID as a string, not an integer -- CockroachDB is storing INT8 (BIGINT), which is a 64-bit integer that ColdFusion cannot safely represent as a number.
// Tell Wheels to treat the ID as a string, not an integer -- CockroachDB is storing INT8 (BIGINT), which is a 64-bit integer that ColdFusion cannot safely represent as a number.
0 commit comments