mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-09 00:49:21 +00:00
235cc8b228
* Moving settings to Database. - Moves many settings into the database. Fixes #2285 - Adds a local_site and instance table. Fixes #2365 . Fixes #2368 - Separates SQL update an insert forms, to avoid runtime errors. - Adds TypedBuilder to all the SQL forms, instead of default. * Fix weird clippy issue. * Removing extra lines. * Some fixes from suggestions. * Fixing apub tests. * Using instance creation helper function. * Move forms to their own line. * Trying to fix local_site_data, still broken. * Fixing federation tests. * Trying to fix check features 1. * Addressing PR comments. * Adding check_apub to all verify functions.
29 lines
909 B
Rust
29 lines
909 B
Rust
use crate::newtypes::InstanceId;
|
|
use serde::{Deserialize, Serialize};
|
|
use std::fmt::Debug;
|
|
|
|
#[cfg(feature = "full")]
|
|
use crate::schema::federation_blocklist;
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
|
#[cfg_attr(
|
|
feature = "full",
|
|
diesel(belongs_to(crate::source::instance::Instance))
|
|
)]
|
|
#[cfg_attr(feature = "full", diesel(table_name = federation_blocklist))]
|
|
pub struct FederationBlockList {
|
|
pub id: i32,
|
|
pub instance_id: InstanceId,
|
|
pub published: chrono::NaiveDateTime,
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
}
|
|
|
|
#[derive(Clone, Default)]
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = federation_blocklist))]
|
|
pub struct FederationBlockListForm {
|
|
pub instance_id: InstanceId,
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
}
|