From 25bbf2b56424df54d0562849988c32e395016d88 Mon Sep 17 00:00:00 2001 From: Satya Date: Fri, 12 Jun 2026 22:11:09 -0400 Subject: [PATCH] merger: generate entity and changelog ids with uuid v7 Switch the two UUID generation sites in the merger from v4 to time-ordered v7, and swap the uuid crate feature flag from v4 to v7 accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) --- Cargo.toml | 2 +- src/merger/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ca1e480..ff410cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ url = "2.5.8" fluent-uri = "0.3.2" idna = "1.1.0" percent-encoding = "2.3.2" -uuid = { version = "1.20.0", features = ["v4", "serde"] } +uuid = { version = "1.20.0", features = ["v7", "serde"] } chrono = { version = "0.4.43", features = ["serde"] } json-pointer = "0.3.4" indexmap = { version = "2.13.0", features = ["serde"] } diff --git a/src/merger/mod.rs b/src/merger/mod.rs index cab224f..af14181 100644 --- a/src/merger/mod.rs +++ b/src/merger/mod.rs @@ -588,7 +588,7 @@ impl Merger { .and_then(|v| v.as_str()) .unwrap_or(""); let id_val = if entity_id.is_empty() { - Value::String(uuid::Uuid::new_v4().to_string()) + Value::String(uuid::Uuid::now_v7().to_string()) } else { Value::String(entity_id.to_string()) }; @@ -980,7 +980,7 @@ impl Merger { Self::quote_literal(&old_val_obj), Self::quote_literal(&new_val_obj), Self::quote_literal(id_str), - Self::quote_literal(&Value::String(uuid::Uuid::new_v4().to_string())), + Self::quote_literal(&Value::String(uuid::Uuid::now_v7().to_string())), Self::quote_literal(&Value::String(change_kind.to_string())), Self::quote_literal(&Value::String(timestamp.to_string())), Self::quote_literal(&Value::String(user_id.to_string()))