fix: correct chat_histories FK to reference projects(guid) #3

Merged
warkanum merged 2 commits from fix/chat-history-fk into main 2026-04-01 14:29:10 +00:00
Member

Fixes #2

Problem

chat_histories.project_id was referencing projects(id) which is a bigserial, causing an error when trying to insert with a UUID project reference.

Fix

  • migrations/019_fix_chat_histories_fk.sql — drops and recreates the FK constraint pointing to projects(guid) on existing deployments
  • migrations/018_chat_histories.sql — corrected for fresh installs
Fixes #2 ## Problem `chat_histories.project_id` was referencing `projects(id)` which is a `bigserial`, causing an error when trying to insert with a UUID project reference. ## Fix - `migrations/019_fix_chat_histories_fk.sql` — drops and recreates the FK constraint pointing to `projects(guid)` on existing deployments - `migrations/018_chat_histories.sql` — corrected for fresh installs
sam added 1 commit 2026-04-01 14:25:35 +00:00
Fixes #2 — project_id on chat_histories was referencing projects(id)
(bigserial) instead of projects(guid) (uuid). Added migration 019 to
repair existing deployments and corrected 018 for fresh installs.
warkanum requested changes 2026-04-01 14:28:15 +00:00
warkanum left a comment
Owner

No need for the fix in migrations/019_fix_chat_histories_fk.sql . I dropped the bugged table manually.

No need for the fix in migrations/019_fix_chat_histories_fk.sql . I dropped the bugged table manually.
sam added 1 commit 2026-04-01 14:28:47 +00:00
Author
Member

Removed migration 019 — since the table was dropped manually, 018_chat_histories.sql (now with the correct projects(guid) FK) will recreate it cleanly on the next migration run.

Removed migration 019 — since the table was dropped manually, `018_chat_histories.sql` (now with the correct `projects(guid)` FK) will recreate it cleanly on the next migration run.
warkanum merged commit 24532ef380 into main 2026-04-01 14:29:10 +00:00
warkanum deleted branch fix/chat-history-fk 2026-04-04 12:18:41 +00:00
Sign in to join this conversation.