- Added Redis Streams operations to the message bus interface and implementation. - Introduced StreamCheckpoint model to track last processed stream entry per document. - Implemented UpsertStreamCheckpoint and GetStreamCheckpoint methods in the Postgres store. - Created document_update_history table for storing update payloads for recovery and replay. - Developed update persist worker to handle Redis Stream updates and persist them to Postgres. - Enhanced Docker Compose configuration for Redis with persistence. - Updated frontend API to support fetching document state with optional share token. - Added connection stability monitoring in the Yjs document hook.
13 lines
496 B
SQL
13 lines
496 B
SQL
-- Migration: Add stream checkpoints table for Redis Streams durability
|
|
-- This table tracks last processed stream position per document
|
|
|
|
CREATE TABLE IF NOT EXISTS stream_checkpoints (
|
|
document_id UUID PRIMARY KEY REFERENCES documents(id) ON DELETE CASCADE,
|
|
last_stream_id TEXT NOT NULL,
|
|
last_seq BIGINT NOT NULL DEFAULT 0,
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_stream_checkpoints_updated_at
|
|
ON stream_checkpoints(updated_at DESC);
|