Repository navigation
refactor: update ids from int32 to int64 - #12
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8177a31a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🔵 Needs a closer look
A system-wide primary-key type migration across security-sensitive auth/session/credential tables, plus a bundled out-of-scope OAuth behavior change, warrants human verification (including a compile/migration run).
1 open finding
What changed in this PR
This PR widens all internal database entity identifiers from 32-bit to 64-bit (serial/integer → bigserial/bigint in Postgres, and int32 → int64 in Go) to support a larger number of users and records. It is a broad, mostly mechanical refactor spanning the DBML schema, the generated sqlc models/queries, DTOs, services, controllers, cache, and crypto helper signatures, plus corresponding pgtype.Int4 → pgtype.Int8 updates for nullable ID columns.
Changes:
- Migrate primary/foreign key ID columns to
bigserial/bigintininitial_schema.dbmland the initial schema migration, and regeneratemodels.goand all*.sql.goquery signatures toint64. - Update hand-written service/controller/cache/crypto code (DTO
ID()getters, option structs, callback type aliases,strconvparsing to base-64) to useint64. - Bundle an unrelated behavioral change to
CreateNativeApp(default response types + added validation) and aproject.mdstatus reorg.
| File | Description |
|---|---|
initial_schema.dbml, migrations/...up.sql |
Change ID columns to bigserial/bigint |
database/models.go, database/*.sql.go |
Regenerated structs/queries with int64 IDs and pgtype.Int8 |
services/*.go, services/dtos/*.go |
Option structs, ID() getters, parsing updated to int64 |
providers/crypto/*.go |
Store/Get callback type aliases widened to int64 |
providers/cache/*.go |
Cache key/options and strconv parsing updated to int64 |
controllers/middleware.go, controllers/users.go, params/users.go |
Locals assertion, URL param, and casts updated to int64 |
services/apps.go |
Includes an out-of-scope CreateNativeApp response-type behavior change |
project.md |
Status list reorganization |
tests/dynamic_registration_test.go |
Scan targets updated to int64 |
I verified the refactor is internally consistent: no leftover int32 ID declarations/casts, Locals("accountID") reads int64 matching its int64 source, remaining pgtype.Int4 usages are non-ID (TTL/MaxAge) columns, and tokens carry UUID public IDs rather than internal ints.
Files not reviewed (18)
- idp/internal/providers/database/account_2fa_configs.sql.go: Generated file
- idp/internal/providers/database/account_credential_secrets.sql.go: Generated file
- idp/internal/providers/database/account_credentials.sql.go: Generated file
- idp/internal/providers/database/account_credentials_keys.sql.go: Generated file
- idp/internal/providers/database/account_data_encryption_keys.sql.go: Generated file
- idp/internal/providers/database/account_dynamic_registration_configs.sql.go: Generated file
- idp/internal/providers/database/account_grants.sql.go: Generated file
- idp/internal/providers/database/account_hmac_secrets.sql.go: Generated file
- idp/internal/providers/database/account_key_encryption_keys.sql.go: Generated file
- idp/internal/providers/database/account_sessions.sql.go: Generated file
- idp/internal/providers/database/account_token_signing_keys.sql.go: Generated file
- idp/internal/providers/database/account_totps.sql.go: Generated file
- idp/internal/providers/database/accounts.sql.go: Generated file
- idp/internal/providers/database/app_designs.sql.go: Generated file
- idp/internal/providers/database/app_dynamic_registration_configs.sql.go: Generated file
- idp/internal/providers/database/app_keys.sql.go: Generated file
- idp/internal/providers/database/app_profiles.sql.go: Generated file
- idp/internal/providers/database/app_secrets.sql.go: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Uses int 64 for IDs to allow for more users
What is the current behavior?
IDs are int 32
Issue Number: N/A
What is the new behavior?