Files
OwnCord/.claude/skills/db-change/SKILL.md
T
J3vb db0275a290 fix: batch of 29 correctness fixes across server and client (#1369)
* fix(ws): 2 defect(s) (OC-0013, OC-0140)

* fix(voice): 1 defect(s) (OC-0044)

* fix(ws): 1 defect(s) (OC-0024)

* fix(server): 1 defect(s) (OC-0027)

* fix(ws): 1 defect(s) (OC-0028)

* fix(server): 7 defect(s) (OC-0033, OC-0066, OC-0067, OC-0068, OC-0074, OC-0077, OC-0106)

* fix(ws): 1 defect(s) (OC-0051)

* fix(client): 1 defect(s) (OC-0053)

* fix(client): 1 defect(s) (OC-0055)

* fix(service): 1 defect(s) (OC-0069)

* fix(voice): 1 defect(s) (OC-0072)

* fix(service): 1 defect(s) (OC-0082)

* fix(client): 1 defect(s) (OC-0083)

* fix(plugin): 1 defect(s) (OC-0088)

* fix(plugin): 4 defect(s) (OC-0104, OC-0126, OC-0127, OC-0133)

* fix(admin): 1 defect(s) (OC-0110)

* fix(client): 1 defect(s) (OC-0114)

* fix(api): 1 defect(s) (OC-0139)

* fix(client): 1 defect(s) (OC-0149)

* test(server): adapt existing tests to updated OpenDM and IncrementMentionCounts signatures

* style(plugin): modernize loops and goroutine spawns in race test

* fix(ws): mirror the focus admission gate in the post-subscribe revalidation

* fix(service): detach DM post-commit side effects from the request ctx, fail delete closed, add empty-fan-out fallback

* fix(plugin): preserve enabled intent when upgrade reactivation hits a runtime-less build

* chore(skills): harden bughunt-fix workflow and fold review lessons into bughunt-run/db-change

* Add comprehensive documentation for task-observer skill

- Introduced environments.md to outline activation setup, compaction behavior, and handoff-doc mode.
- Created skill-authoring.md detailing taxonomy, licensing, confidentiality, and editing rules for skill creation.
- Added weekly-review.md for a structured review process of OPEN observations, including scheduled and in-session fallback modes.

* chore(go): pin toolchain go1.26.6 (stdlib CVE fixes flagged by govulncheck)
2026-08-14 10:05:40 +02:00

2.2 KiB

name, description
name description
db-change Change OwnCord's SQLite schema or queries — add a migration, edit Server/db/queries/*.sql, and regenerate the sqlc layer. Use before touching anything under Server/db/ or Server/migrations/.

db-change

Server/db/dbgen/ is generated. Edit the inputs, regenerate, commit both.

  1. Add the migration to Server/migrations/ and/or edit Server/db/queries/sqlite/*.sql.
  2. Regenerate: make sqlc-generate from Server/.
  3. Commit the regenerated Server/db/dbgen/ alongside your inputs. CI runs make sqlc-verify and fails on drift.

sqlc.version pins the binary (currently v1.30.0). If make is not on PATH:

go install github.com/sqlc-dev/sqlc/cmd/sqlc@$(cat sqlc.version)
$(go env GOPATH)/bin/sqlc generate

Traps

These are silent — the code generates fine and fails at runtime.

Query files must be ASCII-only. sqlc v1.30.0 measures rune positions against byte offsets, so one multi-byte character (an em-dash in a comment is the usual culprit) truncates the next query's emitted SQL by that many trailing bytes. Symptom: the .sql file looks right but the generated const in dbgen/*.sql.go is cut short — ORDER BY id ASC becomes ORDER BY id A, and SQLite reports "incomplete input".

No semicolons inside migration -- comments. splitStatements in Server/db/migrate.go splits on ; before stripping comments, so a semicolon in comment prose orphans the rest of that comment as a bogus statement ("near : syntax error").

Regenerate from a tree where the query files carry only YOUR change. sqlc regenerates every dbgen/ file from every query file on each run, so unrelated working-tree edits to any queries/*.sql — a parallel agent's half-finished work, leftover debris — are silently baked into generated output you then commit. Check git status on Server/db/ before sqlc generate, and diff the regen for hunks that are not yours.

Do not put LIMIT 1 on a :one query. It is emitted as a bare LIMIT. A :one uses QueryRow and reads a single row regardless — use ORDER BY to choose which one.

After regenerating, gopls diagnostics against dbgen go stale. Trust go build, not the editor squiggles.