From 7a36f3f8afacb715e9803cd08a1d5ec385b87db4 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 6 Apr 2023 06:06:09 -0500 Subject: [PATCH] introducing video struct in models.rs --- src/rust/models.rs | 10 ++++++++++ src/rust/schema.rs | 11 +++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/rust/models.rs b/src/rust/models.rs index 45e0ce7..5308068 100644 --- a/src/rust/models.rs +++ b/src/rust/models.rs @@ -6,3 +6,13 @@ pub struct Image { pub title: String, pub path: String, } + +#[derive(Queryable)] +pub struct Video { + pub id: i32, + pub title: String, + pub path: String, + pub start_time: f32, + pub end_time: f32, + pub looping: bool, +} diff --git a/src/rust/schema.rs b/src/rust/schema.rs index 96fcc85..de6257d 100644 --- a/src/rust/schema.rs +++ b/src/rust/schema.rs @@ -40,11 +40,14 @@ diesel::table! { videos (id) { id -> Integer, title -> Text, - filePath -> Text, - startTime -> Nullable, - endTime -> Nullable, + #[sql_name = "filePath"] + path -> Text, + #[sql_name = "filePath"] + start_time -> Nullable, + #[sql_name = "filePath"] + end_time -> Nullable, #[sql_name = "loop"] - loop_ -> Bool, + looping -> Bool, } }