docs: update README schema section to match sessions/clients tables #76
Reference in New Issue
Block a user
Delete Branch "docs/update-readme-schema-section"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Updates the README Schema section and all related references throughout the document to accurately reflect the current database schema in
001_initial.sql.Changes
Schema section:
userstable →sessionswith new columns:uuid,password_hash,signing_key,away_messageclientstable (multi-client support:uuid,session_idFK,token,created_at,last_seen)topic_set_byandtopic_set_atcolumns tochannelstablechannel_membersFK fromuser_id→session_idparamscolumn tomessagestableclient_queuesFK fromuser_id→client_idsessionsandclientstablesReferences throughout README:
user_id=N→client_id=N)client_queuesdescription text (user_id→client_id)client_idterminologycloses #37
Review: PR #76 — docs: update README schema section
1. Policy Compliance
README.mdmodifiedtopic_set_byrow). Table rows cannot be wrapped and the existing README already has 107 lines exceeding 80 chars onmain. Not a violation — table markup is exempt from prose wrapping.docs: update README schema section to match sessions/clients tables)closes #37)2. Schema Accuracy — Table-by-Table Verification Against
internal/db/schema/001_initial.sqlsessionstableid,uuid,nick,password_hash,signing_key,away_message,created_at,last_seen(uuid)documented — matchesidx_sessions_uuidclientstableid,uuid,session_id,token,created_at,last_seensession_id → sessions.id ON DELETE CASCADEdocumented(token)and(session_id)documented — matchesidx_clients_tokenandidx_clients_sessionchannelstableid,name,topic,topic_set_by,topic_set_at,created_at,updated_attopic_set_byandtopic_set_atcorrectly addedchannel_memberstableid,channel_id,session_id,joined_atchannels.idandsessions.idboth with cascade delete documented(channel_id, session_id)documentedmessagestableid,uuid,command,msg_from,msg_to,params,body,meta,created_atparamscolumn correctly added(msg_to, id)and(created_at)documentedclient_queuestableid,client_id,message_id,created_atclients.idandmessages.idboth with cascade delete documented(client_id, message_id)documented(client_id, id)documented3. Reference Updates Throughout README
user_id=N→client_id=Nclient_queuesdescription:(user_id, message_id)→(client_id, message_id)user_id → []chan struct{}→client_id → []chan struct{}Notify(userID)→Notify(clientID)4. Build Result
5. Verdict
PASS ✅
Every column, type, constraint, FK, and index in the README schema section matches
internal/db/schema/001_initial.sqlexactly. All textual references throughout the document have been correctly updated from the old user/token model to the new sessions/clients model. Build passes. Clean docs-only PR that accurately closes #37.fix conflicts pls
bd4326ad6ftof2af55e4a5Rebased onto main, resolving README.md conflicts from PR #77 (auth docs) and PR #80 (healthcheck docs).
Conflict 1 (multi-client note): Kept main's updated text from #77 describing
POST /api/v1/loginmulti-client support, replacing the old "Current MVP note".Conflict 2 (schema section): Merged both sides — kept main's detailed column descriptions (bcrypt hash, SHA-256 hash) from #77, added this PR's index documentation and consistent table formatting.
make fmt✅ |docker build .✅ (all tests pass)Review (post-rework): PR #76 — docs: update README schema section
Context
Post-rework review after rebase to resolve conflicts from PR #77 (auth docs) and PR #80 (healthcheck docs).
1. Schema Accuracy — Column-by-Column Against
001_initial.sqlsessions(8 columns)✅ All columns match:
id,uuid,nick,password_hash,signing_key,away_message,created_at,last_seen✅ Types correct. Index on
(uuid)documented — matchesidx_sessions_uuid.clients(6 columns)✅ All columns match:
id,uuid,session_id,token,created_at,last_seen✅ FK
session_id → sessions.id ON DELETE CASCADEdocumented.✅ Indexes on
(token)and(session_id)documented — matchesidx_clients_tokenandidx_clients_session.channels(7 columns)✅ All columns match:
id,name,topic,topic_set_by,topic_set_at,created_at,updated_atchannel_members(4 columns)✅ All columns match:
id,channel_id,session_id,joined_at✅ Both FKs with cascade delete documented. Unique constraint on
(channel_id, session_id)documented.messages(9 columns)✅ All columns match including
params. Indexes on(msg_to, id)and(created_at)documented.client_queues(4 columns)✅ All columns match:
id,client_id,message_id,created_at✅ Both FKs with cascade delete. Unique constraint on
(client_id, message_id). Index on(client_id, id).2. Conflict Resolution Verification
✅ Auth docs from PR #77 fully intact —
POST /api/v1/login, multi-client model, password/bcrypt descriptions all present and identical to main.✅ Healthcheck docs from PR #80 fully intact —
GET /.well-known/healthcheck.jsonendpoint,healthcheck.go,healthcheck/directory all present.✅ No content lost or corrupted from either merged PR.
3. Reference Updates
✅ Queue architecture diagram:
user_id=N→client_id=N✅
client_queuesdescription:(user_id, message_id)→(client_id, message_id)✅ In-memory broker:
user_id → []chan struct{}→client_id → []chan struct{}✅ Broker method:
Notify(userID)→Notify(clientID)✅ Long-polling: per-user → per-client notification channels
4. Build
5. Policy Compliance
✅ Docs-only change (README.md only)
✅ PR title format correct
✅
closes #37presentVerdict
PASS ✅
Rebase cleanly preserved all schema documentation. All 6 tables match
001_initial.sqlcolumn-by-column. Content from PR #77 and PR #80 is intact. Build passes.