feat(chat): 完成分类锚点坞(CategoryDock)与双轨制未读重构 (含方案A轮次归一化与起始位置居中)
This commit is contained in:
@@ -320,3 +320,18 @@ CREATE TABLE IF NOT EXISTS document_audit_logs (
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_doc_audit_doc_time ON document_audit_logs(doc_id, created_at DESC);
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 11. 会话已读位点双轨表 (Chat Read Positions)
|
||||
-- -----------------------------------------------------------------------------
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user