upend/src/database/inner/models.rs

26 lines
622 B
Rust
Raw Normal View History

use super::schema::{data, meta};
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>,
pub entity: Vec<u8>,
pub entity_searchable: Option<String>,
pub attribute: String,
pub value_str: Option<String>,
pub value_num: Option<f64>,
pub immutable: bool,
pub provenance: String,
pub timestamp: NaiveDateTime,
2020-09-07 21:21:54 +02:00
}
#[derive(Queryable, Insertable, Serialize, Clone, Debug)]
#[table_name = "meta"]
pub struct MetaValue {
pub id: i32,
pub key: String,
pub value: String,
}