2021-03-02 12:41:48 +00:00
|
|
|
use crate::{schema::activity, DbUrl};
|
2020-12-21 13:38:34 +00:00
|
|
|
use serde_json::Value;
|
|
|
|
use std::fmt::Debug;
|
|
|
|
|
|
|
|
#[derive(Queryable, Identifiable, PartialEq, Debug)]
|
|
|
|
#[table_name = "activity"]
|
|
|
|
pub struct Activity {
|
|
|
|
pub id: i32,
|
|
|
|
pub data: Value,
|
|
|
|
pub local: bool,
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
2021-03-02 12:41:48 +00:00
|
|
|
pub ap_id: Option<DbUrl>,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub sensitive: Option<bool>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
#[table_name = "activity"]
|
|
|
|
pub struct ActivityForm {
|
|
|
|
pub data: Value,
|
2021-03-20 20:59:07 +00:00
|
|
|
pub local: Option<bool>,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
2021-03-02 12:41:48 +00:00
|
|
|
pub ap_id: DbUrl,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub sensitive: bool,
|
|
|
|
}
|