use chrono::NaiveDateTime; use serde::Serialize; use super::schema::{data, files}; use crate::util::hash::Hash; #[derive(Queryable, Serialize, Clone, Debug)] pub struct File { pub id: i32, pub hash: Hash, pub path: String, pub valid: bool, pub added: NaiveDateTime, pub size: i64, pub mtime: Option, } #[derive(Insertable, Debug)] #[table_name = "files"] pub struct NewFile { pub hash: Vec, pub path: String, pub added: NaiveDateTime, pub size: i64, pub mtime: Option, } #[derive(Queryable, Insertable, Serialize, Debug)] #[table_name = "data"] pub struct Entry { pub identity: Vec, pub entity: Vec, pub attribute: String, pub value: String, }