Migrate with timestamp

This commit is contained in:
asonix 2023-09-04 22:25:11 -05:00
parent 9c50bbe23a
commit bc49f8ca37
1 changed files with 6 additions and 2 deletions

View File

@ -206,10 +206,14 @@ async fn do_migrate_hash(old_repo: &ArcRepo, new_repo: &ArcRepo, hash: Hash) ->
return Ok(()); return Ok(());
}; };
let _ = new_repo.create_hash(hash.clone(), &identifier).await?;
if let Some(details) = old_repo.details(&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?; 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? { if let Some(identifier) = old_repo.motion_identifier(hash.clone()).await? {