Migration 003 created tables with INTEGER keys referencing TEXT primary
keys from migration 002, causing 'no such column' errors. Fix by
properly dropping old tables before recreating with the integer schema.
Rewrite all tests to use the queries.go API (which matches the live
schema) instead of the model-based API (which expected the old UUID
schema).
CreateUser, GetUserByNick, GetUserByToken exist in both db.go (model-based,
used by tests) and queries.go (simple, used by handlers). Rename the
model-based variants to CreateUserModel, GetUserByNickModel, and
GetUserByTokenModel to resolve the compilation error.
- Fix stuttering type names (e.g. config.ConfigParams → config.Params)
- Add doc comments to all exported types/functions/methods
- Add package doc comments to all packages
- Fix JSON tags to camelCase
- Extract magic numbers to constants
- Add blank lines per nlreturn/wsl_v5 rules
- Use errors.Is() for error comparison
- Unexport NewLoggingResponseWriter (not used externally)
- Replace for-range on ctx.Done() with channel receive
- Rename unused parameters to _
- AGENTS.md: all changes via feature branches, no direct main commits
- internal/models/model.go: DB interface + Base struct for all models
- internal/models/channel.go: Channel model with DB access for relation queries
- Database.NewChannel() factory injects db reference into model instances
- Uses interface to avoid circular imports (models -> db)