Files
Agent-System/deploy/postgres/archive/pre-goose/2026-09-11-chat-read-positions.sql
T
weichenandCursor 265f09c1f2 fix(server): cache health probes, surface SSE marshal errors, fail closed on missing duties
Health checks reuse a two-second snapshot and bound the schema query. Task SSE writes an error frame when an event cannot be encoded. ResolveDocTask errors when the frozen plan has no duty row, while explicit none-duties stay zero. Drop the unwired semantic-summary replace env, record the intentional dev versus release model split, document the test/main cutover path, and archive pre-goose SQL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:16:18 +00:00

19 lines
868 B
SQL

-- ==============================================================================
-- 迁移脚本: chat_read_positions 双轨制未读标记与已读位点管理表
-- 日期: 2026-09-11
-- 描述:
-- 支持连续已读基线 (last_read_message_id) 与离散倒序消费补丁集合 (dismissed_unread_ids)
-- ==============================================================================
CREATE TABLE IF NOT EXISTS chat_read_positions (
session_id VARCHAR(64) NOT NULL,
user_id BIGINT NOT NULL,
last_read_message_id BIGINT NOT NULL DEFAULT 0,
dismissed_unread_ids BIGINT[] NOT NULL DEFAULT '{}',
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (session_id, user_id)
);
CREATE INDEX IF NOT EXISTS idx_chat_read_positions_session_user
ON chat_read_positions (session_id, user_id);