2022-08-19 14:04:18 +02:00
|
|
|
use super::schema::{data, meta};
|
2023-04-02 19:55:51 +02:00
|
|
|
use chrono::NaiveDateTime;
|
2022-10-23 15:59:10 +02:00
|
|
|
use serde::Serialize;
|
2020-09-07 21:21:54 +02:00
|
|
|
|
|
|
|
#[derive(Queryable, Insertable, Serialize, Debug)]
|
|
|
|
#[table_name = "data"]
|
|
|
|
pub struct Entry {
|
|
|
|
pub identity: Vec<u8>,
|
2021-03-14 10:44:13 +01:00
|
|
|
pub entity: Vec<u8>,
|
2022-02-07 18:33:57 +01:00
|
|
|
pub entity_searchable: Option<String>,
|
2021-03-14 10:44:13 +01:00
|
|
|
pub attribute: String,
|
2022-01-28 18:17:14 +01:00
|
|
|
pub value_str: Option<String>,
|
|
|
|
pub value_num: Option<f64>,
|
2022-01-21 17:59:53 +01:00
|
|
|
pub immutable: bool,
|
2023-04-02 19:55:51 +02:00
|
|
|
pub provenance: String,
|
|
|
|
pub timestamp: NaiveDateTime,
|
2020-09-07 21:21:54 +02:00
|
|
|
}
|
2022-01-31 15:57:35 +01:00
|
|
|
|
|
|
|
#[derive(Queryable, Insertable, Serialize, Clone, Debug)]
|
|
|
|
#[table_name = "meta"]
|
|
|
|
pub struct MetaValue {
|
|
|
|
pub id: i32,
|
|
|
|
pub key: String,
|
|
|
|
pub value: String,
|
|
|
|
}
|