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:
Renamed users table → sessions with new columns: uuid, password_hash, signing_key, away_message
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:**
- Renamed `users` table → `sessions` with new columns: `uuid`, `password_hash`, `signing_key`, `away_message`
- Added new `clients` table (multi-client support: `uuid`, `session_id` FK, `token`, `created_at`, `last_seen`)
- Added `topic_set_by` and `topic_set_at` columns to `channels` table
- Updated `channel_members` FK from `user_id` → `session_id`
- Added `params` column to `messages` table
- Updated `client_queues` FK from `user_id` → `client_id`
- Added cascade delete annotations to FK descriptions
- Added index documentation for `sessions` and `clients` tables
**References throughout README:**
- Updated Queue Architecture diagram labels (`user_id=N` → `client_id=N`)
- Updated `client_queues` description text (`user_id` → `client_id`)
- Updated In-Memory Broker description to use `client_id` terminology
- Updated Multi-Client Model MVP note to reflect sessions/clients architecture
- Updated long-polling implementation detail to reference per-client notification channels
closes #37
Update the Schema section and related references throughout README.md to
accurately reflect the current 001_initial.sql migration:
- Rename 'users' table to 'sessions' with new columns: uuid, password_hash,
signing_key, away_message
- Add new 'clients' table (uuid, session_id FK, token, created_at, last_seen)
- Add topic_set_by and topic_set_at columns to 'channels' table
- Update channel_members FK from user_id to session_id
- Add params column to messages table
- Update client_queues FK from user_id to client_id
- Update Queue Architecture diagram labels and surrounding text
- Update In-Memory Broker description to use client_id terminology
- Update Multi-Client Model MVP note to reflect sessions/clients split
Markdown formatting / 80-column wrap: One new table row is 81 chars (topic_set_by row). Table rows cannot be wrapped and the existing README already has 107 lines exceeding 80 chars on main. Not a violation — table markup is exempt from prose wrapping.
No code changes, no new dependencies: ✅
PR title format: ✅ (docs: update README schema section to match sessions/clients tables)
Closes clause: ✅ (closes #37)
2. Schema Accuracy — Table-by-Table Verification Against internal/db/schema/001_initial.sql
sessions table
✅ All 8 columns match SQL: id, uuid, nick, password_hash, signing_key, away_message, created_at, last_seen
✅ Types correct (INTEGER, TEXT, DATETIME)
✅ Index on (uuid) documented — matches idx_sessions_uuid
clients table
✅ All 6 columns match SQL: id, uuid, session_id, token, created_at, last_seen
✅ FK session_id → sessions.id ON DELETE CASCADE documented
✅ Indexes on (token) and (session_id) documented — matches idx_clients_token and idx_clients_session
channels table
✅ All 7 columns match SQL: id, name, topic, topic_set_by, topic_set_at, created_at, updated_at
✅ New columns topic_set_by and topic_set_at correctly added
channel_members table
✅ All 4 columns match SQL: id, channel_id, session_id, joined_at
✅ FKs to channels.id and sessions.id both with cascade delete documented
✅ Unique constraint on (channel_id, session_id) documented
messages table
✅ All 9 columns match SQL: id, uuid, command, msg_from, msg_to, params, body, meta, created_at
✅ New params column correctly added
✅ Indexes on (msg_to, id) and (created_at) documented
client_queues table
✅ All 4 columns match SQL: id, client_id, message_id, created_at
✅ FKs to clients.id and messages.id both with cascade delete documented
✅ Unique constraint on (client_id, message_id) documented
✅ Multi-Client Model MVP note: updated to reflect sessions/clients architecture
4. Build Result
docker build . → SUCCESS
make check (via Dockerfile) → all tests PASS, lint clean, fmt clean
5. Verdict
PASS✅
Every column, type, constraint, FK, and index in the README schema section matches internal/db/schema/001_initial.sql exactly. 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.
## Review: PR #76 — docs: update README schema section
### 1. Policy Compliance
- **Docs-only change**: ✅ Only `README.md` modified
- **Markdown formatting / 80-column wrap**: One new table row is 81 chars (`topic_set_by` row). Table rows cannot be wrapped and the existing README already has 107 lines exceeding 80 chars on `main`. Not a violation — table markup is exempt from prose wrapping.
- **No code changes, no new dependencies**: ✅
- **PR title format**: ✅ (`docs: update README schema section to match sessions/clients tables`)
- **Closes clause**: ✅ (`closes #37`)
### 2. Schema Accuracy — Table-by-Table Verification Against `internal/db/schema/001_initial.sql`
#### `sessions` table
- ✅ All 8 columns match SQL: `id`, `uuid`, `nick`, `password_hash`, `signing_key`, `away_message`, `created_at`, `last_seen`
- ✅ Types correct (INTEGER, TEXT, DATETIME)
- ✅ Index on `(uuid)` documented — matches `idx_sessions_uuid`
#### `clients` table
- ✅ All 6 columns match SQL: `id`, `uuid`, `session_id`, `token`, `created_at`, `last_seen`
- ✅ FK `session_id → sessions.id ON DELETE CASCADE` documented
- ✅ Indexes on `(token)` and `(session_id)` documented — matches `idx_clients_token` and `idx_clients_session`
#### `channels` table
- ✅ All 7 columns match SQL: `id`, `name`, `topic`, `topic_set_by`, `topic_set_at`, `created_at`, `updated_at`
- ✅ New columns `topic_set_by` and `topic_set_at` correctly added
#### `channel_members` table
- ✅ All 4 columns match SQL: `id`, `channel_id`, `session_id`, `joined_at`
- ✅ FKs to `channels.id` and `sessions.id` both with cascade delete documented
- ✅ Unique constraint on `(channel_id, session_id)` documented
#### `messages` table
- ✅ All 9 columns match SQL: `id`, `uuid`, `command`, `msg_from`, `msg_to`, `params`, `body`, `meta`, `created_at`
- ✅ New `params` column correctly added
- ✅ Indexes on `(msg_to, id)` and `(created_at)` documented
#### `client_queues` table
- ✅ All 4 columns match SQL: `id`, `client_id`, `message_id`, `created_at`
- ✅ FKs to `clients.id` and `messages.id` both with cascade delete documented
- ✅ Unique constraint on `(client_id, message_id)` documented
- ✅ Index on `(client_id, id)` documented
### 3. Reference Updates Throughout README
- ✅ Queue Architecture diagram: `user_id=N` → `client_id=N`
- ✅ `client_queues` description: `(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 detail: per-user → per-client notification channels
- ✅ Multi-Client Model MVP note: updated to reflect sessions/clients architecture
### 4. Build Result
```
docker build . → SUCCESS
make check (via Dockerfile) → all tests PASS, lint clean, fmt clean
```
### 5. Verdict
**PASS** ✅
Every column, type, constraint, FK, and index in the README schema section matches `internal/db/schema/001_initial.sql` exactly. 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](https://git.eeqj.de/sneak/chat/issues/37).
Rebased 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/login multi-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)
Rebased onto main, resolving README.md conflicts from [PR #77](https://git.eeqj.de/sneak/chat/pulls/77) (auth docs) and [PR #80](https://git.eeqj.de/sneak/chat/pulls/80) (healthcheck docs).
**Conflict 1** (multi-client note): Kept main's updated text from #77 describing `POST /api/v1/login` multi-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)
✅ 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.json endpoint, healthcheck.go, healthcheck/ directory all present. ✅ No content lost or corrupted from either merged PR.
docker build . → SUCCESS
make check (via Dockerfile) → all tests PASS, lint clean, fmt clean
5. Policy Compliance
✅ Docs-only change (README.md only) ✅ PR title format correct ✅closes #37 present
Verdict
PASS✅
Rebase cleanly preserved all schema documentation. All 6 tables match 001_initial.sql column-by-column. Content from PR #77 and PR #80 is intact. Build passes.
## Review (post-rework): PR #76 — docs: update README schema section
### Context
Post-rework review after rebase to resolve conflicts from [PR #77](https://git.eeqj.de/sneak/chat/pulls/77) (auth docs) and [PR #80](https://git.eeqj.de/sneak/chat/pulls/80) (healthcheck docs).
### 1. Schema Accuracy — Column-by-Column Against `001_initial.sql`
#### `sessions` (8 columns)
✅ All columns match: `id`, `uuid`, `nick`, `password_hash`, `signing_key`, `away_message`, `created_at`, `last_seen`
✅ Types correct. Index on `(uuid)` documented — matches `idx_sessions_uuid`.
#### `clients` (6 columns)
✅ All columns match: `id`, `uuid`, `session_id`, `token`, `created_at`, `last_seen`
✅ FK `session_id → sessions.id ON DELETE CASCADE` documented.
✅ Indexes on `(token)` and `(session_id)` documented — matches `idx_clients_token` and `idx_clients_session`.
#### `channels` (7 columns)
✅ All columns match: `id`, `name`, `topic`, `topic_set_by`, `topic_set_at`, `created_at`, `updated_at`
#### `channel_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](https://git.eeqj.de/sneak/chat/pulls/77) fully intact — `POST /api/v1/login`, multi-client model, password/bcrypt descriptions all present and identical to main.
✅ Healthcheck docs from [PR #80](https://git.eeqj.de/sneak/chat/pulls/80) fully intact — `GET /.well-known/healthcheck.json` endpoint, `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_queues` description: `(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
```
docker build . → SUCCESS
make check (via Dockerfile) → all tests PASS, lint clean, fmt clean
```
### 5. Policy Compliance
✅ Docs-only change (README.md only)
✅ PR title format correct
✅ `closes #37` present
### Verdict
**PASS** ✅
Rebase cleanly preserved all schema documentation. All 6 tables match `001_initial.sql` column-by-column. Content from [PR #77](https://git.eeqj.de/sneak/chat/pulls/77) and [PR #80](https://git.eeqj.de/sneak/chat/pulls/80) is intact. Build passes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.