Consider alternate type for primary keys #4

Closed
opened 2026-05-18 03:52:52 +00:00 by erik · 5 comments
Owner

Consider SERIAL instead of UUID for the primary keys in our tables. Also, weigh the pro's & con's of using UUID v7 instead of UUID v4. Save findings in the wiki.

Consider SERIAL instead of UUID for the primary keys in our tables. Also, weigh the pro's & con's of using UUID v7 instead of UUID v4. Save findings in the wiki.
erik changed title from Consider UUID v7 for primary keys to Consider alternate type for primary keys 2026-05-18 04:00:20 +00:00
agent-pm removed their assignment 2026-05-18 22:24:03 +00:00
Member

Brief — Developer

Phase: simple. Run fjx dev prompt simple for the cycle protocol.

Context

Implement uuidv7() as the default for primary keys on tables.

<!-- pm:brief:dev --> # Brief — Developer **Phase:** simple. Run `fjx dev prompt simple` for the cycle protocol. ## Context Implement `uuidv7()` as the default for primary keys on tables.
Member

Ledger for: agent-pm

Status: closed @ 2026-05-20T05:36:58.705Z
Briefs:

Activity

  1. i4/assign : unrecognized
  2. i4/closed : applied

(PM manages this ledger; agent section unused)

<!-- agent-pm:ledger --> ## Ledger for: agent-pm Status: closed @ 2026-05-20T05:36:58.705Z Briefs: - [dev](#issuecomment-1165) - [test](#issuecomment-1375) - build: absent ### Activity 1. i4/assign : unrecognized 2. i4/closed : applied --- _(PM manages this ledger; agent section unused)_
Member

Ledger for: agent-dev

Status: review @ 2026-05-20T04:56:20.157Z


Tasks

  • Read brief — simple phase: implement uuidv7() as default for primary keys
  • Audit current schema — all tables use uuid PRIMARY KEY DEFAULT gen_random_uuid() (v4)
  • Research SERIAL vs UUID pros/cons (docs in wiki/findings/primary-key-types.md)
  • Research UUID v4 vs UUID v7 (docs in wiki/findings/primary-key-types.md)
  • Replace DEFAULT gen_random_uuid() with DEFAULT uuidv7() in all 6 migration files (9 columns)
  • Add primary key convention note to AGENTS.md
  • just check passes
  • Push to branch and update PR #9

Evidence

  • Commit: d390905 — feat: switch all primary keys to uuidv7()
  • PR: #9
  • 9 columns across 6 migration files updated

Conclusion

All primary keys now use DEFAULT uuidv7(). Postgres 17 ships this natively. Sequential inserts, no B-tree fragmentation, global uniqueness retained.

<!-- agent-dev:ledger --> ## Ledger for: agent-dev Status: review @ 2026-05-20T04:56:20.157Z --- ### Tasks - [x] Read brief — simple phase: implement uuidv7() as default for primary keys - [x] Audit current schema — all tables use `uuid PRIMARY KEY DEFAULT gen_random_uuid()` (v4) - [x] Research SERIAL vs UUID pros/cons (docs in wiki/findings/primary-key-types.md) - [x] Research UUID v4 vs UUID v7 (docs in wiki/findings/primary-key-types.md) - [x] Replace `DEFAULT gen_random_uuid()` with `DEFAULT uuidv7()` in all 6 migration files (9 columns) - [x] Add primary key convention note to AGENTS.md - [x] `just check` passes - [x] Push to branch and update PR #9 ### Evidence - Commit: d390905 — feat: switch all primary keys to uuidv7() - PR: https://git.tfks.net/tfks/trippin/pulls/9 - 9 columns across 6 migration files updated ### Conclusion All primary keys now use `DEFAULT uuidv7()`. Postgres 17 ships this natively. Sequential inserts, no B-tree fragmentation, global uniqueness retained.
agent-dev removed their assignment 2026-05-20 04:11:03 +00:00
Author
Owner

/assign @agent-dev since already has the context, proceed with implementing uuidv7

/assign @agent-dev since already has the context, proceed with implementing uuidv7
Member

Brief — Tester

Phase: review. Run fjx test prompt default for the cycle protocol.

<!-- pm:brief:test --> # Brief — Tester **Phase:** review. Run `fjx test prompt default` for the cycle protocol.
agent-dev removed their assignment 2026-05-20 04:56:25 +00:00
Sign in to join this conversation.
No description provided.