lemmy/crates/db_schema/src/source/activity.rs
Dessalines 3d08e6c1fc
Adding unique constraint for activity ap_id. Fixes #1878 (#1935)
* Adding unique constraint for activity ap_id. Fixes #1878

* Removing is_activity_already_known
2021-11-22 18:57:03 +00:00

25 lines
613 B
Rust

use crate::{newtypes::DbUrl, schema::activity};
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>,
pub ap_id: DbUrl,
pub sensitive: Option<bool>,
}
#[derive(Insertable, AsChangeset)]
#[table_name = "activity"]
pub struct ActivityForm {
pub data: Value,
pub local: Option<bool>,
pub updated: Option<chrono::NaiveDateTime>,
pub ap_id: DbUrl,
pub sensitive: bool,
}