From bc49f8ca3703586c76444a568527dc8625f99855 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 4 Sep 2023 22:25:11 -0500 Subject: [PATCH] Migrate with timestamp --- src/repo/migrate.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/repo/migrate.rs b/src/repo/migrate.rs index 60dbe68..e10177a 100644 --- a/src/repo/migrate.rs +++ b/src/repo/migrate.rs @@ -206,10 +206,14 @@ async fn do_migrate_hash(old_repo: &ArcRepo, new_repo: &ArcRepo, hash: Hash) -> return Ok(()); }; - let _ = new_repo.create_hash(hash.clone(), &identifier).await?; - if let Some(details) = old_repo.details(&identifier).await? { + let _ = new_repo + .create_hash_with_timestamp(hash.clone(), &identifier, details.created_at()) + .await?; + new_repo.relate_details(&identifier, &details).await?; + } else { + let _ = new_repo.create_hash(hash.clone(), &identifier).await?; } if let Some(identifier) = old_repo.motion_identifier(hash.clone()).await? {