c9f1407429
* Initial commit to bump diesel to 2.0.0-rc.0 and see what happens * Add chrono feature from diesel * db_schema crate is close to building? * Upgrade diesel-derive-newtype * Mostly modifying references to connections to be mutable ones; also used new way to do migrations as suggested by the migration guide; a lot more compiles now, though I can't figure out this tricky ToSql issue at the moment * Running clippy --fix * Trying to fix drone clippy 1 * Fix clippy * Upgrade clux-musl * Trying to fix drone clippy 2 * Trying to fix drone clippy 3 * Trying to fix drone clippy 5 * Adding diesel table aliases, removing sql view hack. Fixes #2101 Co-authored-by: Steven Chu <stevenc1@gmail.com> Co-authored-by: Nutomic <me@nutomic.com>
25 lines
629 B
Rust
25 lines
629 B
Rust
use crate::{newtypes::DbUrl, schema::activity};
|
|
use serde_json::Value;
|
|
use std::fmt::Debug;
|
|
|
|
#[derive(PartialEq, Eq, Debug, Queryable, Identifiable)]
|
|
#[diesel(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)]
|
|
#[diesel(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,
|
|
}
|