mirror of
https://github.com/willchen96/mike.git
synced 2026-07-24 23:41:04 +02:00
Merge pull request #212 from jmooves/upstream-pr/chat-messages-workflow-column
fix(db): add missing chat_messages.workflow column (user prompts dropped on reload)
This commit is contained in:
commit
0843e2909a
2 changed files with 13 additions and 0 deletions
12
backend/migrations/20260716_01_chat_messages_workflow.sql
Normal file
12
backend/migrations/20260716_01_chat_messages_workflow.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- Add chat_messages.workflow.
|
||||
--
|
||||
-- The app persists a `workflow` field on user messages
|
||||
-- (backend/src/routes/chat.ts, projectChat.ts) and reads it back when rendering
|
||||
-- chat history (frontend ChatView -> UserMessage, to show which workflow the
|
||||
-- message was sent under). The column was referenced in code but never created
|
||||
-- by schema.sql or any migration, so every user-message insert failed with
|
||||
-- PostgREST PGRST204 ("Could not find the 'workflow' column") and was dropped
|
||||
-- silently — user prompts vanished on reload while the assistant reply
|
||||
-- persisted. Mirrors the existing content/files jsonb columns.
|
||||
alter table public.chat_messages
|
||||
add column if not exists workflow jsonb;
|
||||
|
|
@ -550,6 +550,7 @@ create table if not exists public.chat_messages (
|
|||
role text not null,
|
||||
content jsonb,
|
||||
files jsonb,
|
||||
workflow jsonb,
|
||||
citations jsonb,
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue