diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2023-04-11 16:26:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-11 16:26:16 +0100 |
| commit | 03dd3ddf8b8c0ad254850cd940728c888dd7a80c (patch) | |
| tree | 2ebac480115be4b20ad5385362aa9dd988bc9799 /atuin-client/src/history.rs | |
| parent | Add additional detail to search documentation (#860) (diff) | |
| download | atuin-03dd3ddf8b8c0ad254850cd940728c888dd7a80c.zip | |
Switch to uuidv7 (#864)
* Add uuid_v7
* Actually use the new uuid
* Add a test to ensure all uuids are unique, even in a tight loop
* Make clippy happy
Diffstat (limited to 'atuin-client/src/history.rs')
| -rw-r--r-- | atuin-client/src/history.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/atuin-client/src/history.rs b/atuin-client/src/history.rs index a710db2b..bb50a02a 100644 --- a/atuin-client/src/history.rs +++ b/atuin-client/src/history.rs @@ -3,7 +3,7 @@ use std::env; use chrono::Utc; use serde::{Deserialize, Serialize}; -use atuin_common::utils::uuid_v4; +use atuin_common::utils::uuid_v7; // Any new fields MUST be Optional<>! #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, sqlx::FromRow)] @@ -48,12 +48,12 @@ impl History { ) -> Self { let session = session .or_else(|| env::var("ATUIN_SESSION").ok()) - .unwrap_or_else(uuid_v4); + .unwrap_or_else(|| uuid_v7().as_simple().to_string()); let hostname = hostname.unwrap_or_else(|| format!("{}:{}", whoami::hostname(), whoami::username())); Self { - id: uuid_v4(), + id: uuid_v7().as_simple().to_string(), timestamp, command, cwd, |
