Files
khb_microservices/packages/khb_common/migrations/022_channel_recap_state.sql
Yuri Yaryshev 4a32a08b6d
All checks were successful
ci / test (push) Successful in 27s
ci / deploy (push) Successful in 2m13s
Проектные каналы: тихий режим, recap для Daily Log; Huddle через message_changed; короткие напоминания
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 21:12:07 +03:00

15 lines
1.5 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Проектные каналы: ассистент молчит, пока люди общаются между собой, копит факты для Daily Log и по тишине (или после заметок Huddle)
-- одним сообщением спрашивает "Should I add this to the Daily Log?". Здесь - накопленное и состояние вопроса по каналу.
create table channel_recap_state (
channel_id text primary key,
manager_person_id uuid references person(id), -- ответственный менеджер проекта (ключ памяти и сессии агента)
job_id text, -- проект JobTread канала
notes text not null default '', -- накопленные факты (строки с временем и автором)
status text not null default 'collecting' check (status in ('collecting', 'asked')),
last_human_at timestamptz not null default now(), -- последнее сообщение людей в канале (от него считается тишина)
asked_at timestamptz, -- когда задан вопрос про Daily Log
attempts integer not null default 0, -- сколько раз по тишине будили агента без вопроса
updated_at timestamptz not null default now()
);
alter table channel_recap_state enable row level security;