From 6d9bab59919352bbdd5dd354c89c95d78a8f04a2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 26 Dec 2018 22:50:38 -0800 Subject: rust impl last webcapture schema tweaks --- rust/src/api_entity_crud.rs | 2 +- rust/src/bin/fatcat-export.rs | 12 ++++++------ rust/src/database_models.rs | 8 ++++---- rust/src/database_schema.rs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'rust/src') diff --git a/rust/src/api_entity_crud.rs b/rust/src/api_entity_crud.rs index 19817540..cab6f58f 100644 --- a/rust/src/api_entity_crud.rs +++ b/rust/src/api_entity_crud.rs @@ -1334,7 +1334,7 @@ impl EntityCrud for WebcaptureEntity { .map(|c| WebcaptureRevCdxNewRow { webcapture_rev: *rev_id, surt: c.surt.clone(), - timestamp: c.timestamp, + timestamp: c.timestamp.clone(), url: c.url.clone(), mimetype: c.mimetype.clone(), status_code: c.status_code, diff --git a/rust/src/bin/fatcat-export.rs b/rust/src/bin/fatcat-export.rs index 8b7c4442..ec66ed4c 100644 --- a/rust/src/bin/fatcat-export.rs +++ b/rust/src/bin/fatcat-export.rs @@ -207,12 +207,12 @@ pub fn do_export( ExportEntityType::File => { thread::spawn(move || loop_work_file(row_receiver, output_sender, &db_conn, expand)) } - ExportEntityType::Fileset => { - thread::spawn(move || loop_work_fileset(row_receiver, output_sender, &db_conn, expand)) - } - ExportEntityType::Webcapture=> { - thread::spawn(move || loop_work_webcapture(row_receiver, output_sender, &db_conn, expand)) - } + ExportEntityType::Fileset => thread::spawn(move || { + loop_work_fileset(row_receiver, output_sender, &db_conn, expand) + }), + ExportEntityType::Webcapture => thread::spawn(move || { + loop_work_webcapture(row_receiver, output_sender, &db_conn, expand) + }), ExportEntityType::Release => thread::spawn(move || { loop_work_release(row_receiver, output_sender, &db_conn, expand) }), diff --git a/rust/src/database_models.rs b/rust/src/database_models.rs index c913b98e..d2f6c3c2 100644 --- a/rust/src/database_models.rs +++ b/rust/src/database_models.rs @@ -305,10 +305,10 @@ pub struct WebcaptureRevCdxRow { pub id: i64, pub webcapture_rev: Uuid, pub surt: String, - pub timestamp: i64, + pub timestamp: String, pub url: String, pub mimetype: Option, - pub status_code: i64, + pub status_code: Option, pub sha1: String, pub sha256: Option, } @@ -318,10 +318,10 @@ pub struct WebcaptureRevCdxRow { pub struct WebcaptureRevCdxNewRow { pub webcapture_rev: Uuid, pub surt: String, - pub timestamp: i64, + pub timestamp: String, pub url: String, pub mimetype: Option, - pub status_code: i64, + pub status_code: Option, pub sha1: String, pub sha256: Option, } diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs index 436f2989..5db14de5 100644 --- a/rust/src/database_schema.rs +++ b/rust/src/database_schema.rs @@ -330,10 +330,10 @@ table! { id -> Int8, webcapture_rev -> Uuid, surt -> Text, - timestamp -> Int8, + timestamp -> Text, url -> Text, mimetype -> Nullable, - status_code -> Int8, + status_code -> Nullable, sha1 -> Text, sha256 -> Nullable, } -- cgit v1.2.3