From f456f5da4604cae2d3f3422283bf236b0a13fca6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 13 Dec 2020 12:04:42 -0500 Subject: [PATCH] Re-organizing source tables into a different folder. --- lemmy_api/src/claims.rs | 2 +- lemmy_api/src/comment.rs | 5 +---- lemmy_api/src/community.rs | 6 +----- lemmy_api/src/lib.rs | 8 +++++--- lemmy_api/src/post.rs | 3 +-- lemmy_api/src/site.rs | 4 +--- lemmy_api/src/user.rs | 20 ++++++++++--------- lemmy_apub/src/activities/receive/comment.rs | 6 ++++-- .../src/activities/receive/comment_undo.rs | 2 +- .../src/activities/receive/community.rs | 2 +- lemmy_apub/src/activities/receive/mod.rs | 2 +- lemmy_apub/src/activities/receive/post.rs | 2 +- .../src/activities/receive/post_undo.rs | 2 +- .../src/activities/receive/private_message.rs | 2 +- lemmy_apub/src/activities/send/comment.rs | 6 +++++- lemmy_apub/src/activities/send/community.rs | 2 +- lemmy_apub/src/activities/send/post.rs | 5 ++++- .../src/activities/send/private_message.rs | 5 ++++- lemmy_apub/src/activities/send/user.rs | 6 ++++-- lemmy_apub/src/activity_queue.rs | 5 ++++- lemmy_apub/src/extensions/group_extensions.rs | 2 +- lemmy_apub/src/fetcher.rs | 10 ++++++---- lemmy_apub/src/http/comment.rs | 2 +- lemmy_apub/src/http/community.rs | 3 +-- lemmy_apub/src/http/mod.rs | 2 +- lemmy_apub/src/http/post.rs | 2 +- lemmy_apub/src/http/user.rs | 2 +- lemmy_apub/src/inbox/community_inbox.rs | 6 ++++-- lemmy_apub/src/inbox/mod.rs | 6 +++++- lemmy_apub/src/inbox/receive_for_community.rs | 6 +++++- lemmy_apub/src/inbox/shared_inbox.rs | 2 +- lemmy_apub/src/inbox/user_inbox.rs | 8 +++++--- lemmy_apub/src/lib.rs | 5 ++++- lemmy_apub/src/objects/comment.rs | 10 ++++++---- lemmy_apub/src/objects/community.rs | 2 +- lemmy_apub/src/objects/post.rs | 8 +++++--- lemmy_apub/src/objects/private_message.rs | 6 ++++-- lemmy_apub/src/objects/user.rs | 2 +- .../src/aggregates/community_aggregates.rs | 10 ++++++---- lemmy_db/src/aggregates/post_aggregates.rs | 10 ++++++---- lemmy_db/src/aggregates/site_aggregates.rs | 10 ++++++---- lemmy_db/src/aggregates/user_aggregates.rs | 10 ++++++---- lemmy_db/src/comment_report.rs | 2 +- lemmy_db/src/comment_view.rs | 5 +---- lemmy_db/src/lib.rs | 17 ++++------------ lemmy_db/src/post_report.rs | 2 +- lemmy_db/src/{ => source}/activity.rs | 6 ++++-- lemmy_db/src/{ => source}/category.rs | 2 +- lemmy_db/src/{ => source}/comment.rs | 5 +---- lemmy_db/src/{ => source}/community.rs | 9 +++++++-- lemmy_db/src/source/mod.rs | 11 ++++++++++ lemmy_db/src/{ => source}/moderator.rs | 6 +----- .../{ => source}/password_reset_request.rs | 2 +- lemmy_db/src/{ => source}/post.rs | 4 +--- lemmy_db/src/{ => source}/private_message.rs | 3 +-- lemmy_db/src/{ => source}/site.rs | 0 lemmy_db/src/{ => source}/user.rs | 4 ++-- lemmy_db/src/{ => source}/user_mention.rs | 6 +----- lemmy_db/src/views/community_follower_view.rs | 6 ++++-- .../src/views/community_moderator_view.rs | 6 ++++-- lemmy_db/src/views/community_user_ban_view.rs | 6 ++++-- lemmy_db/src/views/community_view.rs | 8 +++++--- lemmy_db/src/views/post_view.rs | 12 +++++------ lemmy_db/src/views/site_view.rs | 6 ++++-- lemmy_db/src/views/user_view.rs | 2 +- lemmy_structs/src/lib.rs | 10 ++++++---- lemmy_structs/src/site.rs | 3 +-- src/code_migrations.rs | 12 ++++++----- src/routes/feeds.rs | 3 +-- src/routes/webfinger.rs | 2 +- tests/integration_test.rs | 6 ++++-- 71 files changed, 216 insertions(+), 169 deletions(-) rename lemmy_db/src/{ => source}/activity.rs (98%) rename lemmy_db/src/{ => source}/category.rs (94%) rename lemmy_db/src/{ => source}/comment.rs (99%) rename lemmy_db/src/{ => source}/community.rs (98%) create mode 100644 lemmy_db/src/source/mod.rs rename lemmy_db/src/{ => source}/moderator.rs (99%) rename lemmy_db/src/{ => source}/password_reset_request.rs (98%) rename lemmy_db/src/{ => source}/post.rs (99%) rename lemmy_db/src/{ => source}/private_message.rs (99%) rename lemmy_db/src/{ => source}/site.rs (100%) rename lemmy_db/src/{ => source}/user.rs (98%) rename lemmy_db/src/{ => source}/user_mention.rs (98%) diff --git a/lemmy_api/src/claims.rs b/lemmy_api/src/claims.rs index f475f1dfe..4a0ab12b8 100644 --- a/lemmy_api/src/claims.rs +++ b/lemmy_api/src/claims.rs @@ -1,5 +1,5 @@ use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation}; -use lemmy_db::user::User_; +use lemmy_db::source::user::User_; use lemmy_utils::settings::Settings; use serde::{Deserialize, Serialize}; diff --git a/lemmy_api/src/comment.rs b/lemmy_api/src/comment.rs index 5ad62f146..fe5fe859a 100644 --- a/lemmy_api/src/comment.rs +++ b/lemmy_api/src/comment.rs @@ -10,12 +10,9 @@ use crate::{ use actix_web::web::Data; use lemmy_apub::{ApubLikeableType, ApubObjectType}; use lemmy_db::{ - comment::*, comment_report::*, comment_view::*, - moderator::*, - post::*, - user::*, + source::{comment::*, moderator::*, post::*, user::*}, views::site_view::SiteView, Crud, Likeable, diff --git a/lemmy_api/src/community.rs b/lemmy_api/src/community.rs index fe7748f94..b704d24b9 100644 --- a/lemmy_api/src/community.rs +++ b/lemmy_api/src/community.rs @@ -10,14 +10,10 @@ use actix_web::web::Data; use anyhow::Context; use lemmy_apub::ActorType; use lemmy_db::{ - comment::Comment, comment_view::CommentQueryBuilder, - community::*, diesel_option_overwrite, - moderator::*, naive_now, - post::Post, - site::*, + source::{comment::Comment, community::*, moderator::*, post::Post, site::*}, views::{ community_follower_view::CommunityFollowerView, community_moderator_view::CommunityModeratorView, diff --git a/lemmy_api/src/lib.rs b/lemmy_api/src/lib.rs index 13998dc4d..92287f8d3 100644 --- a/lemmy_api/src/lib.rs +++ b/lemmy_api/src/lib.rs @@ -1,9 +1,11 @@ use crate::claims::Claims; use actix_web::{web, web::Data}; use lemmy_db::{ - community::{Community, CommunityModerator}, - post::Post, - user::User_, + source::{ + community::{Community, CommunityModerator}, + post::Post, + user::User_, + }, views::community_user_ban_view::CommunityUserBanView, Crud, DbPool, diff --git a/lemmy_api/src/post.rs b/lemmy_api/src/post.rs index 66c174e7d..2b3b4b5b4 100644 --- a/lemmy_api/src/post.rs +++ b/lemmy_api/src/post.rs @@ -11,10 +11,9 @@ use actix_web::web::Data; use lemmy_apub::{ApubLikeableType, ApubObjectType}; use lemmy_db::{ comment_view::*, - moderator::*, naive_now, - post::*, post_report::*, + source::{moderator::*, post::*}, views::{ community_moderator_view::CommunityModeratorView, community_view::CommunityView, diff --git a/lemmy_api/src/site.rs b/lemmy_api/src/site.rs index f1ef6e269..98c501f1a 100644 --- a/lemmy_api/src/site.rs +++ b/lemmy_api/src/site.rs @@ -11,13 +11,11 @@ use anyhow::Context; use lemmy_apub::fetcher::search_by_apub_id; use lemmy_db::{ aggregates::site_aggregates::SiteAggregates, - category::*, comment_view::*, diesel_option_overwrite, - moderator::*, moderator_views::*, naive_now, - site::*, + source::{category::*, moderator::*, site::*}, views::{ community_view::CommunityQueryBuilder, post_view::PostQueryBuilder, diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index b8131fa31..e8099af89 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -15,21 +15,23 @@ use captcha::{gen, Difficulty}; use chrono::Duration; use lemmy_apub::ApubObjectType; use lemmy_db::{ - comment::*, comment_report::CommentReportView, comment_view::*, - community::*, diesel_option_overwrite, - moderator::*, naive_now, - password_reset_request::*, - post::*, post_report::PostReportView, - private_message::*, private_message_view::*, - site::*, - user::*, - user_mention::*, + source::{ + comment::*, + community::*, + moderator::*, + password_reset_request::*, + post::*, + private_message::*, + site::*, + user::*, + user_mention::*, + }, user_mention_view::*, views::{ community_follower_view::CommunityFollowerView, diff --git a/lemmy_apub/src/activities/receive/comment.rs b/lemmy_apub/src/activities/receive/comment.rs index ff0fb8199..f545a0426 100644 --- a/lemmy_apub/src/activities/receive/comment.rs +++ b/lemmy_apub/src/activities/receive/comment.rs @@ -5,9 +5,11 @@ use activitystreams::{ }; use anyhow::Context; use lemmy_db::{ - comment::{Comment, CommentLike, CommentLikeForm}, comment_view::CommentView, - post::Post, + source::{ + comment::{Comment, CommentLike, CommentLikeForm}, + post::Post, + }, Likeable, }; use lemmy_structs::{blocking, comment::CommentResponse, send_local_notifs}; diff --git a/lemmy_apub/src/activities/receive/comment_undo.rs b/lemmy_apub/src/activities/receive/comment_undo.rs index 2ee8c6ea7..bf91fe3dd 100644 --- a/lemmy_apub/src/activities/receive/comment_undo.rs +++ b/lemmy_apub/src/activities/receive/comment_undo.rs @@ -1,8 +1,8 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; use lemmy_db::{ - comment::{Comment, CommentLike}, comment_view::CommentView, + source::comment::{Comment, CommentLike}, Likeable, }; use lemmy_structs::{blocking, comment::CommentResponse}; diff --git a/lemmy_apub/src/activities/receive/community.rs b/lemmy_apub/src/activities/receive/community.rs index 16b0c4e3c..cacb54eef 100644 --- a/lemmy_apub/src/activities/receive/community.rs +++ b/lemmy_apub/src/activities/receive/community.rs @@ -4,7 +4,7 @@ use activitystreams::{ base::{AnyBase, ExtendsExt}, }; use anyhow::Context; -use lemmy_db::{community::Community, views::community_view::CommunityView, ApubObject}; +use lemmy_db::{source::community::Community, views::community_view::CommunityView, ApubObject}; use lemmy_structs::{blocking, community::CommunityResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation}; diff --git a/lemmy_apub/src/activities/receive/mod.rs b/lemmy_apub/src/activities/receive/mod.rs index 1f17fe9f3..a66ddfb95 100644 --- a/lemmy_apub/src/activities/receive/mod.rs +++ b/lemmy_apub/src/activities/receive/mod.rs @@ -5,7 +5,7 @@ use activitystreams::{ error::DomainError, }; use anyhow::{anyhow, Context}; -use lemmy_db::user::User_; +use lemmy_db::source::user::User_; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/lemmy_apub/src/activities/receive/post.rs b/lemmy_apub/src/activities/receive/post.rs index f3ac96c2f..f09071129 100644 --- a/lemmy_apub/src/activities/receive/post.rs +++ b/lemmy_apub/src/activities/receive/post.rs @@ -5,7 +5,7 @@ use activitystreams::{ }; use anyhow::Context; use lemmy_db::{ - post::{Post, PostLike, PostLikeForm}, + source::post::{Post, PostLike, PostLikeForm}, views::post_view::PostView, Likeable, }; diff --git a/lemmy_apub/src/activities/receive/post_undo.rs b/lemmy_apub/src/activities/receive/post_undo.rs index 9cc01b7d3..6827ded05 100644 --- a/lemmy_apub/src/activities/receive/post_undo.rs +++ b/lemmy_apub/src/activities/receive/post_undo.rs @@ -1,7 +1,7 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; use lemmy_db::{ - post::{Post, PostLike}, + source::post::{Post, PostLike}, views::post_view::PostView, Likeable, }; diff --git a/lemmy_apub/src/activities/receive/private_message.rs b/lemmy_apub/src/activities/receive/private_message.rs index f05b52379..25d4c26c5 100644 --- a/lemmy_apub/src/activities/receive/private_message.rs +++ b/lemmy_apub/src/activities/receive/private_message.rs @@ -13,7 +13,7 @@ use activitystreams::{ public, }; use anyhow::{anyhow, Context}; -use lemmy_db::{private_message::PrivateMessage, private_message_view::PrivateMessageView}; +use lemmy_db::{private_message_view::PrivateMessageView, source::private_message::PrivateMessage}; use lemmy_structs::{blocking, user::PrivateMessageResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendUserRoomMessage, LemmyContext, UserOperation}; diff --git a/lemmy_apub/src/activities/send/comment.rs b/lemmy_apub/src/activities/send/comment.rs index 744a1cddb..6b417c259 100644 --- a/lemmy_apub/src/activities/send/comment.rs +++ b/lemmy_apub/src/activities/send/comment.rs @@ -26,7 +26,11 @@ use activitystreams::{ }; use anyhow::anyhow; use itertools::Itertools; -use lemmy_db::{comment::Comment, community::Community, post::Post, user::User_, Crud, DbPool}; +use lemmy_db::{ + source::{comment::Comment, community::Community, post::Post, user::User_}, + Crud, + DbPool, +}; use lemmy_structs::{blocking, WebFingerResponse}; use lemmy_utils::{ request::{retry, RecvError}, diff --git a/lemmy_apub/src/activities/send/community.rs b/lemmy_apub/src/activities/send/community.rs index b1a2352d3..8596fc4e3 100644 --- a/lemmy_apub/src/activities/send/community.rs +++ b/lemmy_apub/src/activities/send/community.rs @@ -24,7 +24,7 @@ use activitystreams::{ use anyhow::Context; use itertools::Itertools; use lemmy_db::{ - community::Community, + source::community::Community, views::community_follower_view::CommunityFollowerView, DbPool, }; diff --git a/lemmy_apub/src/activities/send/post.rs b/lemmy_apub/src/activities/send/post.rs index f6eabb048..ec1ca67de 100644 --- a/lemmy_apub/src/activities/send/post.rs +++ b/lemmy_apub/src/activities/send/post.rs @@ -21,7 +21,10 @@ use activitystreams::{ prelude::*, public, }; -use lemmy_db::{community::Community, post::Post, user::User_, Crud}; +use lemmy_db::{ + source::{community::Community, post::Post, user::User_}, + Crud, +}; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activities/send/private_message.rs b/lemmy_apub/src/activities/send/private_message.rs index e8bc979a7..9abe70d66 100644 --- a/lemmy_apub/src/activities/send/private_message.rs +++ b/lemmy_apub/src/activities/send/private_message.rs @@ -16,7 +16,10 @@ use activitystreams::{ }, prelude::*, }; -use lemmy_db::{private_message::PrivateMessage, user::User_, Crud}; +use lemmy_db::{ + source::{private_message::PrivateMessage, user::User_}, + Crud, +}; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activities/send/user.rs b/lemmy_apub/src/activities/send/user.rs index 8c539c4b0..26c5a5d56 100644 --- a/lemmy_apub/src/activities/send/user.rs +++ b/lemmy_apub/src/activities/send/user.rs @@ -14,8 +14,10 @@ use activitystreams::{ object::ObjectExt, }; use lemmy_db::{ - community::{Community, CommunityFollower, CommunityFollowerForm}, - user::User_, + source::{ + community::{Community, CommunityFollower, CommunityFollowerForm}, + user::User_, + }, ApubObject, DbPool, Followable, diff --git a/lemmy_apub/src/activity_queue.rs b/lemmy_apub/src/activity_queue.rs index 467802794..07990457c 100644 --- a/lemmy_apub/src/activity_queue.rs +++ b/lemmy_apub/src/activity_queue.rs @@ -19,7 +19,10 @@ use background_jobs::{ WorkerConfig, }; use itertools::Itertools; -use lemmy_db::{community::Community, user::User_, DbPool}; +use lemmy_db::{ + source::{community::Community, user::User_}, + DbPool, +}; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use log::{debug, warn}; diff --git a/lemmy_apub/src/extensions/group_extensions.rs b/lemmy_apub/src/extensions/group_extensions.rs index cb1526720..ab7acf337 100644 --- a/lemmy_apub/src/extensions/group_extensions.rs +++ b/lemmy_apub/src/extensions/group_extensions.rs @@ -1,7 +1,7 @@ use activitystreams::unparsed::UnparsedMutExt; use activitystreams_ext::UnparsedExtension; use diesel::PgConnection; -use lemmy_db::{category::Category, Crud}; +use lemmy_db::{source::category::Category, Crud}; use lemmy_utils::LemmyError; use serde::{Deserialize, Serialize}; diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index 5614af65a..2d40673fe 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -13,12 +13,14 @@ use anyhow::{anyhow, Context}; use chrono::NaiveDateTime; use diesel::result::Error::NotFound; use lemmy_db::{ - comment::Comment, comment_view::CommentView, - community::{Community, CommunityModerator, CommunityModeratorForm}, naive_now, - post::Post, - user::User_, + source::{ + comment::Comment, + community::{Community, CommunityModerator, CommunityModeratorForm}, + post::Post, + user::User_, + }, views::{community_view::CommunityView, post_view::PostView, user_view::UserViewSafe}, ApubObject, Joinable, diff --git a/lemmy_apub/src/http/comment.rs b/lemmy_apub/src/http/comment.rs index bb3d13ace..16f411902 100644 --- a/lemmy_apub/src/http/comment.rs +++ b/lemmy_apub/src/http/comment.rs @@ -4,7 +4,7 @@ use crate::{ }; use actix_web::{body::Body, web, web::Path, HttpResponse}; use diesel::result::Error::NotFound; -use lemmy_db::{comment::Comment, Crud}; +use lemmy_db::{source::comment::Comment, Crud}; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/http/community.rs b/lemmy_apub/src/http/community.rs index d2a18ee0b..3caaf6613 100644 --- a/lemmy_apub/src/http/community.rs +++ b/lemmy_apub/src/http/community.rs @@ -10,8 +10,7 @@ use activitystreams::{ }; use actix_web::{body::Body, web, HttpResponse}; use lemmy_db::{ - community::Community, - post::Post, + source::{community::Community, post::Post}, views::community_follower_view::CommunityFollowerView, }; use lemmy_structs::blocking; diff --git a/lemmy_apub/src/http/mod.rs b/lemmy_apub/src/http/mod.rs index 4f31f6a5e..fee15b773 100644 --- a/lemmy_apub/src/http/mod.rs +++ b/lemmy_apub/src/http/mod.rs @@ -1,6 +1,6 @@ use crate::APUB_JSON_CONTENT_TYPE; use actix_web::{body::Body, web, HttpResponse}; -use lemmy_db::activity::Activity; +use lemmy_db::source::activity::Activity; use lemmy_structs::blocking; use lemmy_utils::{settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/http/post.rs b/lemmy_apub/src/http/post.rs index 1d25ed958..563af8456 100644 --- a/lemmy_apub/src/http/post.rs +++ b/lemmy_apub/src/http/post.rs @@ -4,7 +4,7 @@ use crate::{ }; use actix_web::{body::Body, web, HttpResponse}; use diesel::result::Error::NotFound; -use lemmy_db::post::Post; +use lemmy_db::source::post::Post; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/http/user.rs b/lemmy_apub/src/http/user.rs index 1e546d953..8dcc8edab 100644 --- a/lemmy_apub/src/http/user.rs +++ b/lemmy_apub/src/http/user.rs @@ -9,7 +9,7 @@ use activitystreams::{ collection::{CollectionExt, OrderedCollection}, }; use actix_web::{body::Body, web, HttpResponse}; -use lemmy_db::user::User_; +use lemmy_db::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/community_inbox.rs b/lemmy_apub/src/inbox/community_inbox.rs index 1c7b32e90..82df26bea 100644 --- a/lemmy_apub/src/inbox/community_inbox.rs +++ b/lemmy_apub/src/inbox/community_inbox.rs @@ -27,8 +27,10 @@ use activitystreams::{ use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; use lemmy_db::{ - community::{Community, CommunityFollower, CommunityFollowerForm}, - user::User_, + source::{ + community::{Community, CommunityFollower, CommunityFollowerForm}, + user::User_, + }, views::community_user_ban_view::CommunityUserBanView, ApubObject, DbPool, diff --git a/lemmy_apub/src/inbox/mod.rs b/lemmy_apub/src/inbox/mod.rs index d36a34c9b..415851883 100644 --- a/lemmy_apub/src/inbox/mod.rs +++ b/lemmy_apub/src/inbox/mod.rs @@ -12,7 +12,11 @@ use activitystreams::{ }; use actix_web::HttpRequest; use anyhow::{anyhow, Context}; -use lemmy_db::{activity::Activity, community::Community, user::User_, ApubObject, DbPool}; +use lemmy_db::{ + source::{activity::Activity, community::Community, user::User_}, + ApubObject, + DbPool, +}; use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/receive_for_community.rs b/lemmy_apub/src/inbox/receive_for_community.rs index eaad6b1cc..73deb9717 100644 --- a/lemmy_apub/src/inbox/receive_for_community.rs +++ b/lemmy_apub/src/inbox/receive_for_community.rs @@ -41,7 +41,11 @@ use activitystreams::{ }; use anyhow::Context; use diesel::result::Error::NotFound; -use lemmy_db::{comment::Comment, post::Post, site::Site, ApubObject, Crud}; +use lemmy_db::{ + source::{comment::Comment, post::Post, site::Site}, + ApubObject, + Crud, +}; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/shared_inbox.rs b/lemmy_apub/src/inbox/shared_inbox.rs index 010862295..d94c54f25 100644 --- a/lemmy_apub/src/inbox/shared_inbox.rs +++ b/lemmy_apub/src/inbox/shared_inbox.rs @@ -15,7 +15,7 @@ use crate::{ use activitystreams::{activity::ActorAndObject, prelude::*}; use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::Context; -use lemmy_db::{community::Community, ApubObject, DbPool}; +use lemmy_db::{source::community::Community, ApubObject, DbPool}; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/user_inbox.rs b/lemmy_apub/src/inbox/user_inbox.rs index 28f2de60f..374772d6d 100644 --- a/lemmy_apub/src/inbox/user_inbox.rs +++ b/lemmy_apub/src/inbox/user_inbox.rs @@ -49,9 +49,11 @@ use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; use diesel::NotFound; use lemmy_db::{ - community::{Community, CommunityFollower}, - private_message::PrivateMessage, - user::User_, + source::{ + community::{Community, CommunityFollower}, + private_message::PrivateMessage, + user::User_, + }, ApubObject, Followable, }; diff --git a/lemmy_apub/src/lib.rs b/lemmy_apub/src/lib.rs index 9b933b6e0..78224c32e 100644 --- a/lemmy_apub/src/lib.rs +++ b/lemmy_apub/src/lib.rs @@ -22,7 +22,10 @@ use activitystreams::{ }; use activitystreams_ext::{Ext1, Ext2}; use anyhow::{anyhow, Context}; -use lemmy_db::{activity::Activity, user::User_, DbPool}; +use lemmy_db::{ + source::{activity::Activity, user::User_}, + DbPool, +}; use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/objects/comment.rs b/lemmy_apub/src/objects/comment.rs index 56d75a404..957966d7f 100644 --- a/lemmy_apub/src/objects/comment.rs +++ b/lemmy_apub/src/objects/comment.rs @@ -24,10 +24,12 @@ use activitystreams::{ }; use anyhow::{anyhow, Context}; use lemmy_db::{ - comment::{Comment, CommentForm}, - community::Community, - post::Post, - user::User_, + source::{ + comment::{Comment, CommentForm}, + community::Community, + post::Post, + user::User_, + }, Crud, DbPool, }; diff --git a/lemmy_apub/src/objects/community.rs b/lemmy_apub/src/objects/community.rs index 8cc5b9eb5..3bd47560e 100644 --- a/lemmy_apub/src/objects/community.rs +++ b/lemmy_apub/src/objects/community.rs @@ -23,8 +23,8 @@ use activitystreams::{ use activitystreams_ext::Ext2; use anyhow::Context; use lemmy_db::{ - community::{Community, CommunityForm}, naive_now, + source::community::{Community, CommunityForm}, views::community_moderator_view::CommunityModeratorView, DbPool, }; diff --git a/lemmy_apub/src/objects/post.rs b/lemmy_apub/src/objects/post.rs index 39b749972..9c9df5b19 100644 --- a/lemmy_apub/src/objects/post.rs +++ b/lemmy_apub/src/objects/post.rs @@ -21,9 +21,11 @@ use activitystreams::{ use activitystreams_ext::Ext1; use anyhow::Context; use lemmy_db::{ - community::Community, - post::{Post, PostForm}, - user::User_, + source::{ + community::Community, + post::{Post, PostForm}, + user::User_, + }, Crud, DbPool, }; diff --git a/lemmy_apub/src/objects/private_message.rs b/lemmy_apub/src/objects/private_message.rs index ec8b55e7e..e69c28110 100644 --- a/lemmy_apub/src/objects/private_message.rs +++ b/lemmy_apub/src/objects/private_message.rs @@ -20,8 +20,10 @@ use activitystreams::{ }; use anyhow::Context; use lemmy_db::{ - private_message::{PrivateMessage, PrivateMessageForm}, - user::User_, + source::{ + private_message::{PrivateMessage, PrivateMessageForm}, + user::User_, + }, Crud, DbPool, }; diff --git a/lemmy_apub/src/objects/user.rs b/lemmy_apub/src/objects/user.rs index 18490796a..8c3312d1f 100644 --- a/lemmy_apub/src/objects/user.rs +++ b/lemmy_apub/src/objects/user.rs @@ -20,7 +20,7 @@ use activitystreams_ext::Ext1; use anyhow::Context; use lemmy_db::{ naive_now, - user::{UserForm, User_}, + source::user::{UserForm, User_}, ApubObject, DbPool, }; diff --git a/lemmy_db/src/aggregates/community_aggregates.rs b/lemmy_db/src/aggregates/community_aggregates.rs index 04257c506..8c977bf0c 100644 --- a/lemmy_db/src/aggregates/community_aggregates.rs +++ b/lemmy_db/src/aggregates/community_aggregates.rs @@ -24,11 +24,13 @@ impl CommunityAggregates { mod tests { use crate::{ aggregates::community_aggregates::CommunityAggregates, - comment::{Comment, CommentForm}, - community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, - post::{Post, PostForm}, + source::{ + comment::{Comment, CommentForm}, + community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, + post::{Post, PostForm}, + user::{UserForm, User_}, + }, tests::establish_unpooled_connection, - user::{UserForm, User_}, Crud, Followable, ListingType, diff --git a/lemmy_db/src/aggregates/post_aggregates.rs b/lemmy_db/src/aggregates/post_aggregates.rs index 07db37efd..dff16f9b1 100644 --- a/lemmy_db/src/aggregates/post_aggregates.rs +++ b/lemmy_db/src/aggregates/post_aggregates.rs @@ -26,11 +26,13 @@ impl PostAggregates { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - comment::{Comment, CommentForm}, - community::{Community, CommunityForm}, - post::{Post, PostForm, PostLike, PostLikeForm}, + source::{ + comment::{Comment, CommentForm}, + community::{Community, CommunityForm}, + post::{Post, PostForm, PostLike, PostLikeForm}, + user::{UserForm, User_}, + }, tests::establish_unpooled_connection, - user::{UserForm, User_}, Crud, Likeable, ListingType, diff --git a/lemmy_db/src/aggregates/site_aggregates.rs b/lemmy_db/src/aggregates/site_aggregates.rs index 76b45555b..6856bfc9e 100644 --- a/lemmy_db/src/aggregates/site_aggregates.rs +++ b/lemmy_db/src/aggregates/site_aggregates.rs @@ -22,11 +22,13 @@ impl SiteAggregates { mod tests { use crate::{ aggregates::site_aggregates::SiteAggregates, - comment::{Comment, CommentForm}, - community::{Community, CommunityForm}, - post::{Post, PostForm}, + source::{ + comment::{Comment, CommentForm}, + community::{Community, CommunityForm}, + post::{Post, PostForm}, + user::{UserForm, User_}, + }, tests::establish_unpooled_connection, - user::{UserForm, User_}, Crud, ListingType, SortType, diff --git a/lemmy_db/src/aggregates/user_aggregates.rs b/lemmy_db/src/aggregates/user_aggregates.rs index e962c0dd4..104bf6f7d 100644 --- a/lemmy_db/src/aggregates/user_aggregates.rs +++ b/lemmy_db/src/aggregates/user_aggregates.rs @@ -25,11 +25,13 @@ impl UserAggregates { mod tests { use crate::{ aggregates::user_aggregates::UserAggregates, - comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, - community::{Community, CommunityForm}, - post::{Post, PostForm, PostLike, PostLikeForm}, + source::{ + comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, + community::{Community, CommunityForm}, + post::{Post, PostForm, PostLike, PostLikeForm}, + user::{UserForm, User_}, + }, tests::establish_unpooled_connection, - user::{UserForm, User_}, Crud, Likeable, ListingType, diff --git a/lemmy_db/src/comment_report.rs b/lemmy_db/src/comment_report.rs index a243891eb..240b73430 100644 --- a/lemmy_db/src/comment_report.rs +++ b/lemmy_db/src/comment_report.rs @@ -2,10 +2,10 @@ use diesel::{dsl::*, pg::Pg, result::Error, *}; use serde::{Deserialize, Serialize}; use crate::{ - comment::Comment, limit_and_offset, naive_now, schema::comment_report, + source::comment::Comment, MaybeOptional, Reportable, }; diff --git a/lemmy_db/src/comment_view.rs b/lemmy_db/src/comment_view.rs index 4b6dc1924..f463168b6 100644 --- a/lemmy_db/src/comment_view.rs +++ b/lemmy_db/src/comment_view.rs @@ -497,12 +497,9 @@ impl<'a> ReplyQueryBuilder<'a> { #[cfg(test)] mod tests { use crate::{ - comment::*, comment_view::*, - community::*, - post::*, + source::{comment::*, community::*, post::*, user::*}, tests::establish_unpooled_connection, - user::*, Crud, Likeable, *, diff --git a/lemmy_db/src/lib.rs b/lemmy_db/src/lib.rs index 5488360a6..098a88e4a 100644 --- a/lemmy_db/src/lib.rs +++ b/lemmy_db/src/lib.rs @@ -11,25 +11,16 @@ use regex::Regex; use serde::{Deserialize, Serialize}; use std::{env, env::VarError}; -pub mod activity; -pub mod aggregates; -pub mod category; -pub mod comment; pub mod comment_report; pub mod comment_view; -pub mod community; -pub mod moderator; pub mod moderator_views; -pub mod password_reset_request; -pub mod post; pub mod post_report; -pub mod private_message; pub mod private_message_view; -pub mod schema; -pub mod site; -pub mod user; -pub mod user_mention; pub mod user_mention_view; + +pub mod aggregates; +pub mod schema; +pub mod source; pub mod views; pub type DbPool = diesel::r2d2::Pool>; diff --git a/lemmy_db/src/post_report.rs b/lemmy_db/src/post_report.rs index 5f8aa5ea5..230368c5c 100644 --- a/lemmy_db/src/post_report.rs +++ b/lemmy_db/src/post_report.rs @@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize}; use crate::{ limit_and_offset, naive_now, - post::Post, schema::post_report, + source::post::Post, MaybeOptional, Reportable, }; diff --git a/lemmy_db/src/activity.rs b/lemmy_db/src/source/activity.rs similarity index 98% rename from lemmy_db/src/activity.rs rename to lemmy_db/src/source/activity.rs index 190dd411c..b4b54c6ed 100644 --- a/lemmy_db/src/activity.rs +++ b/lemmy_db/src/source/activity.rs @@ -97,9 +97,11 @@ impl Activity { #[cfg(test)] mod tests { use crate::{ - activity::{Activity, ActivityForm}, + source::{ + activity::{Activity, ActivityForm}, + user::{UserForm, User_}, + }, tests::establish_unpooled_connection, - user::{UserForm, User_}, Crud, ListingType, SortType, diff --git a/lemmy_db/src/category.rs b/lemmy_db/src/source/category.rs similarity index 94% rename from lemmy_db/src/category.rs rename to lemmy_db/src/source/category.rs index af2e72265..95b65dc82 100644 --- a/lemmy_db/src/category.rs +++ b/lemmy_db/src/source/category.rs @@ -48,7 +48,7 @@ impl Category { #[cfg(test)] mod tests { - use crate::{category::Category, tests::establish_unpooled_connection}; + use crate::{source::category::Category, tests::establish_unpooled_connection}; #[test] fn test_crud() { diff --git a/lemmy_db/src/comment.rs b/lemmy_db/src/source/comment.rs similarity index 99% rename from lemmy_db/src/comment.rs rename to lemmy_db/src/source/comment.rs index fb327a308..dd4fb39de 100644 --- a/lemmy_db/src/comment.rs +++ b/lemmy_db/src/source/comment.rs @@ -260,11 +260,8 @@ impl Saveable for CommentSaved { #[cfg(test)] mod tests { use crate::{ - comment::*, - community::*, - post::*, + source::{comment::*, community::*, post::*, user::*}, tests::establish_unpooled_connection, - user::*, Crud, ListingType, SortType, diff --git a/lemmy_db/src/community.rs b/lemmy_db/src/source/community.rs similarity index 98% rename from lemmy_db/src/community.rs rename to lemmy_db/src/source/community.rs index eda643ad5..ea7a028e1 100644 --- a/lemmy_db/src/community.rs +++ b/lemmy_db/src/source/community.rs @@ -55,7 +55,7 @@ pub struct CommunitySafe { } mod safe_type { - use crate::{community::Community, schema::community::columns::*, ToSafe}; + use crate::{schema::community::columns::*, source::community::Community, ToSafe}; type Columns = ( id, name, @@ -415,7 +415,12 @@ impl Followable for CommunityFollower { #[cfg(test)] mod tests { - use crate::{community::*, tests::establish_unpooled_connection, user::*, ListingType, SortType}; + use crate::{ + source::{community::*, user::*}, + tests::establish_unpooled_connection, + ListingType, + SortType, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/mod.rs b/lemmy_db/src/source/mod.rs new file mode 100644 index 000000000..2247cd889 --- /dev/null +++ b/lemmy_db/src/source/mod.rs @@ -0,0 +1,11 @@ +pub mod activity; +pub mod category; +pub mod comment; +pub mod community; +pub mod moderator; +pub mod password_reset_request; +pub mod post; +pub mod private_message; +pub mod site; +pub mod user; +pub mod user_mention; diff --git a/lemmy_db/src/moderator.rs b/lemmy_db/src/source/moderator.rs similarity index 99% rename from lemmy_db/src/moderator.rs rename to lemmy_db/src/source/moderator.rs index c0c0ff106..1be3e31b8 100644 --- a/lemmy_db/src/moderator.rs +++ b/lemmy_db/src/source/moderator.rs @@ -392,12 +392,8 @@ impl Crud for ModAdd { #[cfg(test)] mod tests { use crate::{ - comment::*, - community::*, - moderator::*, - post::*, + source::{comment::*, community::*, moderator::*, post::*, user::*}, tests::establish_unpooled_connection, - user::*, ListingType, SortType, }; diff --git a/lemmy_db/src/password_reset_request.rs b/lemmy_db/src/source/password_reset_request.rs similarity index 98% rename from lemmy_db/src/password_reset_request.rs rename to lemmy_db/src/source/password_reset_request.rs index 8ae18cbd4..0cf0169f0 100644 --- a/lemmy_db/src/password_reset_request.rs +++ b/lemmy_db/src/source/password_reset_request.rs @@ -80,7 +80,7 @@ impl PasswordResetRequest { mod tests { use super::super::user::*; use crate::{ - password_reset_request::PasswordResetRequest, + source::password_reset_request::PasswordResetRequest, tests::establish_unpooled_connection, Crud, ListingType, diff --git a/lemmy_db/src/post.rs b/lemmy_db/src/source/post.rs similarity index 99% rename from lemmy_db/src/post.rs rename to lemmy_db/src/source/post.rs index 5767c72b7..b584798e8 100644 --- a/lemmy_db/src/post.rs +++ b/lemmy_db/src/source/post.rs @@ -332,10 +332,8 @@ impl Readable for PostRead { #[cfg(test)] mod tests { use crate::{ - community::*, - post::*, + source::{community::*, post::*, user::*}, tests::establish_unpooled_connection, - user::*, ListingType, SortType, }; diff --git a/lemmy_db/src/private_message.rs b/lemmy_db/src/source/private_message.rs similarity index 99% rename from lemmy_db/src/private_message.rs rename to lemmy_db/src/source/private_message.rs index 0e1aef108..47bb78fbb 100644 --- a/lemmy_db/src/private_message.rs +++ b/lemmy_db/src/source/private_message.rs @@ -138,9 +138,8 @@ impl PrivateMessage { #[cfg(test)] mod tests { use crate::{ - private_message::*, + source::{private_message::*, user::*}, tests::establish_unpooled_connection, - user::*, ListingType, SortType, }; diff --git a/lemmy_db/src/site.rs b/lemmy_db/src/source/site.rs similarity index 100% rename from lemmy_db/src/site.rs rename to lemmy_db/src/source/site.rs diff --git a/lemmy_db/src/user.rs b/lemmy_db/src/source/user.rs similarity index 98% rename from lemmy_db/src/user.rs rename to lemmy_db/src/source/user.rs index 41d3ed18b..5fdb56bbc 100644 --- a/lemmy_db/src/user.rs +++ b/lemmy_db/src/source/user.rs @@ -62,7 +62,7 @@ pub struct UserSafe { } mod safe_type { - use crate::{schema::user_::columns::*, user::User_, ToSafe}; + use crate::{schema::user_::columns::*, source::user::User_, ToSafe}; type Columns = ( id, name, @@ -275,7 +275,7 @@ impl User_ { #[cfg(test)] mod tests { - use crate::{tests::establish_unpooled_connection, user::*, ListingType, SortType}; + use crate::{source::user::*, tests::establish_unpooled_connection, ListingType, SortType}; #[test] fn test_crud() { diff --git a/lemmy_db/src/user_mention.rs b/lemmy_db/src/source/user_mention.rs similarity index 98% rename from lemmy_db/src/user_mention.rs rename to lemmy_db/src/source/user_mention.rs index 68f566332..7ad965218 100644 --- a/lemmy_db/src/user_mention.rs +++ b/lemmy_db/src/source/user_mention.rs @@ -73,12 +73,8 @@ impl UserMention { #[cfg(test)] mod tests { use crate::{ - comment::*, - community::*, - post::*, + source::{comment::*, community::*, post::*, user::*, user_mention::*}, tests::establish_unpooled_connection, - user::*, - user_mention::*, ListingType, SortType, }; diff --git a/lemmy_db/src/views/community_follower_view.rs b/lemmy_db/src/views/community_follower_view.rs index 555a9bcd2..64adae3b7 100644 --- a/lemmy_db/src/views/community_follower_view.rs +++ b/lemmy_db/src/views/community_follower_view.rs @@ -1,7 +1,9 @@ use crate::{ - community::{Community, CommunitySafe}, schema::{community, community_follower, user_}, - user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, views::ViewToVec, ToSafe, }; diff --git a/lemmy_db/src/views/community_moderator_view.rs b/lemmy_db/src/views/community_moderator_view.rs index a2196ea34..c98f072a1 100644 --- a/lemmy_db/src/views/community_moderator_view.rs +++ b/lemmy_db/src/views/community_moderator_view.rs @@ -1,7 +1,9 @@ use crate::{ - community::{Community, CommunitySafe}, schema::{community, community_moderator, user_}, - user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, views::ViewToVec, ToSafe, }; diff --git a/lemmy_db/src/views/community_user_ban_view.rs b/lemmy_db/src/views/community_user_ban_view.rs index faaae0f2d..3358f01b2 100644 --- a/lemmy_db/src/views/community_user_ban_view.rs +++ b/lemmy_db/src/views/community_user_ban_view.rs @@ -1,7 +1,9 @@ use crate::{ - community::{Community, CommunitySafe}, schema::{community, community_user_ban, user_}, - user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, ToSafe, }; use diesel::{result::Error, *}; diff --git a/lemmy_db/src/views/community_view.rs b/lemmy_db/src/views/community_view.rs index 0ac5081e6..d4518f7f4 100644 --- a/lemmy_db/src/views/community_view.rs +++ b/lemmy_db/src/views/community_view.rs @@ -1,12 +1,14 @@ use crate::{ aggregates::community_aggregates::CommunityAggregates, - category::Category, - community::{Community, CommunityFollower, CommunitySafe}, functions::hot_rank, fuzzy_search, limit_and_offset, schema::{category, community, community_aggregates, community_follower, user_}, - user::{UserSafe, User_}, + source::{ + category::Category, + community::{Community, CommunityFollower, CommunitySafe}, + user::{UserSafe, User_}, + }, views::ViewToVec, MaybeOptional, SortType, diff --git a/lemmy_db/src/views/post_view.rs b/lemmy_db/src/views/post_view.rs index dc21e621b..4888f9cfb 100644 --- a/lemmy_db/src/views/post_view.rs +++ b/lemmy_db/src/views/post_view.rs @@ -1,10 +1,8 @@ use crate::{ aggregates::post_aggregates::PostAggregates, - community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, functions::hot_rank, fuzzy_search, limit_and_offset, - post::{Post, PostRead, PostSaved}, schema::{ community, community_follower, @@ -16,7 +14,11 @@ use crate::{ post_saved, user_, }, - user::{UserSafe, User_}, + source::{ + community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, + post::{Post, PostRead, PostSaved}, + user::{UserSafe, User_}, + }, views::ViewToVec, ListingType, MaybeOptional, @@ -589,10 +591,8 @@ impl ViewToVec for PostView { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - community::*, - post::*, + source::{community::*, post::*, user::*}, tests::establish_unpooled_connection, - user::*, views::post_view::{PostQueryBuilder, PostView}, Crud, Likeable, diff --git a/lemmy_db/src/views/site_view.rs b/lemmy_db/src/views/site_view.rs index c00b83789..d10702fca 100644 --- a/lemmy_db/src/views/site_view.rs +++ b/lemmy_db/src/views/site_view.rs @@ -1,7 +1,9 @@ use crate::{ schema::{site, user_}, - site::Site, - user::{UserSafe, User_}, + source::{ + site::Site, + user::{UserSafe, User_}, + }, ToSafe, }; use diesel::{result::Error, *}; diff --git a/lemmy_db/src/views/user_view.rs b/lemmy_db/src/views/user_view.rs index dae264097..4d4e78c7f 100644 --- a/lemmy_db/src/views/user_view.rs +++ b/lemmy_db/src/views/user_view.rs @@ -3,7 +3,7 @@ use crate::{ fuzzy_search, limit_and_offset, schema::{user_, user_aggregates}, - user::{UserSafe, User_}, + source::user::{UserSafe, User_}, views::ViewToVec, MaybeOptional, SortType, diff --git a/lemmy_structs/src/lib.rs b/lemmy_structs/src/lib.rs index 5d2e42733..3a2e28d94 100644 --- a/lemmy_structs/src/lib.rs +++ b/lemmy_structs/src/lib.rs @@ -7,10 +7,12 @@ pub mod websocket; use diesel::PgConnection; use lemmy_db::{ - comment::Comment, - post::Post, - user::User_, - user_mention::{UserMention, UserMentionForm}, + source::{ + comment::Comment, + post::Post, + user::User_, + user_mention::{UserMention, UserMentionForm}, + }, Crud, DbPool, }; diff --git a/lemmy_structs/src/site.rs b/lemmy_structs/src/site.rs index 74badcd31..002c3ace2 100644 --- a/lemmy_structs/src/site.rs +++ b/lemmy_structs/src/site.rs @@ -1,9 +1,8 @@ use lemmy_db::{ aggregates::site_aggregates::SiteAggregates, - category::*, comment_view::*, moderator_views::*, - user::*, + source::{category::*, user::*}, views::{ community_view::CommunityView, post_view::PostView, diff --git a/src/code_migrations.rs b/src/code_migrations.rs index c41f5bd96..7a749e9b4 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -4,12 +4,14 @@ use diesel::{ *, }; use lemmy_db::{ - comment::Comment, - community::{Community, CommunityForm}, naive_now, - post::Post, - private_message::PrivateMessage, - user::{UserForm, User_}, + source::{ + comment::Comment, + community::{Community, CommunityForm}, + post::Post, + private_message::PrivateMessage, + user::{UserForm, User_}, + }, Crud, }; use lemmy_utils::{ diff --git a/src/routes/feeds.rs b/src/routes/feeds.rs index 4dd7643aa..887faa88d 100644 --- a/src/routes/feeds.rs +++ b/src/routes/feeds.rs @@ -5,8 +5,7 @@ use diesel::PgConnection; use lemmy_api::claims::Claims; use lemmy_db::{ comment_view::{ReplyQueryBuilder, ReplyView}, - community::Community, - user::User_, + source::{community::Community, user::User_}, user_mention_view::{UserMentionQueryBuilder, UserMentionView}, views::{ post_view::{PostQueryBuilder, PostView}, diff --git a/src/routes/webfinger.rs b/src/routes/webfinger.rs index ba687abdf..d59b4e389 100644 --- a/src/routes/webfinger.rs +++ b/src/routes/webfinger.rs @@ -1,6 +1,6 @@ use actix_web::{error::ErrorBadRequest, web::Query, *}; use anyhow::anyhow; -use lemmy_db::{community::Community, user::User_}; +use lemmy_db::source::{community::Community, user::User_}; use lemmy_structs::{blocking, WebFingerLink, WebFingerResponse}; use lemmy_utils::{ settings::Settings, diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 2a79dd4b5..a61c8ff6e 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -29,8 +29,10 @@ use lemmy_apub::{ }, }; use lemmy_db::{ - community::{Community, CommunityForm}, - user::{User_, *}, + source::{ + community::{Community, CommunityForm}, + user::{User_, *}, + }, Crud, ListingType, SortType,