summaryrefslogtreecommitdiffstats
path: root/server/src/db/community.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/db/community.rs')
-rw-r--r--server/src/db/community.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/src/db/community.rs b/server/src/db/community.rs
index dd6ea94b..e07b5c00 100644
--- a/server/src/db/community.rs
+++ b/server/src/db/community.rs
@@ -101,6 +101,16 @@ impl Joinable<CommunityModeratorForm> for CommunityModerator {
}
}
+impl CommunityModerator {
+ pub fn delete_for_community(conn: &PgConnection, for_community_id: i32) -> Result<usize, Error> {
+ use crate::schema::community_moderator::dsl::*;
+ diesel::delete(
+ community_moderator
+ .filter(community_id.eq(for_community_id)))
+ .execute(conn)
+ }
+}
+
#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
#[belongs_to(Community)]
#[table_name = "community_user_ban"]