22 lines
433 B
Rust
22 lines
433 B
Rust
use super::schema::files;
|
|
use chrono::NaiveDateTime;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Queryable, Serialize)]
|
|
pub struct File {
|
|
pub id: i32,
|
|
pub hash: String,
|
|
pub path: String,
|
|
pub size: i64,
|
|
pub created: NaiveDateTime,
|
|
pub valid: bool,
|
|
}
|
|
|
|
#[derive(Insertable, Debug)]
|
|
#[table_name = "files"]
|
|
pub struct NewFile {
|
|
pub hash: String,
|
|
pub path: String,
|
|
pub size: i64,
|
|
pub created: NaiveDateTime,
|
|
}
|