Skip to content

fix(core): add room tables to SCHEMA constant for fresh DB - #596

Merged
ajianaz merged 1 commit into
developfrom
fix/room-schema
Jul 7, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/room-schema

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fresh databases were missing rooms and room_memories tables because the CREATE TABLE statements were only in the migration (v2→v3), not in the SCHEMA constant.

Problem

  • SCHEMA constant at store.rs lacked room tables
  • Fresh DB init skipped migration → no room tables created
  • uteke room create/list/stats would fail on fresh installs

Fix

Add CREATE TABLE IF NOT EXISTS for both tables to the SCHEMA constant, matching migration v2→v3 columns exactly:

  • rooms: id, title, namespace, created_at, updated_at
  • room_memories: room_id, memory_id, author, role, joined_at

Test

  • Fresh DB (rm -rf + uteke-serve): both tables created with correct columns
  • POST /room/create: works
  • GET /room/list: returns room with updated_at
  • Existing DB (migration path): unchanged (IF NOT EXISTS)
  • cargo build: clean
  • cargo fmt: clean

Files Changed

crates/uteke-core/src/memory/store.rs (+21 lines)

Add rooms and room_memories CREATE TABLE statements to SCHEMA
so fresh databases get room tables without needing migration.
Matches migration v2→v3 columns exactly:
- rooms: id, title, namespace, created_at, updated_at
- room_memories: room_id, memory_id, author, role, joined_at
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review recommended — warnings found.

🟡 Warning (1)

  • unknown:? — Cora AI review could not complete: LLM API returned status 400: {"error":{"message":"Unsupported parameter: max_output_tokens","type":"invalid_request_error"}}. Review was skipped; no code quality issues were found by the automated check.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit c0b75e9 into develop Jul 7, 2026
8 of 9 checks passed
@ajianaz
ajianaz deleted the fix/room-schema branch July 7, 2026 00:44
ajianaz added a commit that referenced this pull request Aug 13, 2026
fix(core): add room tables to SCHEMA constant for fresh DB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant