CREATE TABLE thoth_memory.archive_repairs ( workspace_id text NOT NULL, session_id text NOT NULL, repair_id text NOT NULL, data jsonb NOT NULL, created_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (workspace_id, session_id, repair_id) ); ALTER TABLE thoth_memory.archive_repairs ENABLE ROW LEVEL SECURITY; ALTER TABLE thoth_memory.archive_repairs FORCE ROW LEVEL SECURITY; CREATE POLICY workspace_isolation ON thoth_memory.archive_repairs USING (workspace_id = current_setting('thoth.memory_workspace', true)) WITH CHECK (workspace_id = current_setting('thoth.memory_workspace', true)); GRANT SELECT, INSERT, UPDATE ON thoth_memory.archive_repairs TO thoth_memory_runtime;