feat: add AI chat for repports

This commit is contained in:
2026-04-28 07:19:49 +02:00
parent 087bcab16b
commit 490a364c00
10 changed files with 340 additions and 5 deletions

View File

@ -0,0 +1,8 @@
CREATE TABLE report_messages (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
report_id UUID NOT NULL REFERENCES reports(id) ON DELETE CASCADE,
role VARCHAR(10) NOT NULL CHECK (role IN ('user', 'assistant')),
content TEXT NOT NULL,
status VARCHAR(10) NOT NULL DEFAULT 'done' CHECK (status IN ('done', 'generating', 'error')),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);