2021-10-16 13:33:38 +00:00
|
|
|
use crate::{newtypes::DbUrl, schema::activity};
|
2020-12-21 13:38:34 +00:00
|
|
|
use serde_json::Value;
|
|
|
|
use std::fmt::Debug;
|
|
|
|
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(PartialEq, Eq, Debug, Queryable, Identifiable)]
|
|
|
|
#[diesel(table_name = activity)]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct Activity {
|
|
|
|
pub id: i32,
|
|
|
|
pub data: Value,
|
|
|
|
pub local: bool,
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
2021-11-22 18:57:03 +00:00
|
|
|
pub ap_id: DbUrl,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub sensitive: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
}
|
|
|
|
|
2022-10-27 09:24:07 +00:00
|
|
|
#[derive(Insertable)]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[diesel(table_name = activity)]
|
2022-10-27 09:24:07 +00:00
|
|
|
pub struct ActivityInsertForm {
|
2020-12-21 13:38:34 +00:00
|
|
|
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,
|
2022-10-27 09:24:07 +00:00
|
|
|
pub sensitive: Option<bool>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(AsChangeset)]
|
|
|
|
#[diesel(table_name = activity)]
|
|
|
|
pub struct ActivityUpdateForm {
|
|
|
|
pub data: Option<Value>,
|
|
|
|
pub local: Option<bool>,
|
|
|
|
pub updated: Option<Option<chrono::NaiveDateTime>>,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub sensitive: Option<bool>,
|
2020-12-21 13:38:34 +00:00
|
|
|
}
|