fix(core/database): skip insertion / deletion if no invites need to be corrected
This commit is contained in:
@@ -1051,6 +1051,7 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
|||||||
})
|
})
|
||||||
.collect::<Vec<Invite>>();
|
.collect::<Vec<Invite>>();
|
||||||
|
|
||||||
|
if !invites.is_empty() {
|
||||||
db.db()
|
db.db()
|
||||||
.collection("channel_invites")
|
.collection("channel_invites")
|
||||||
.insert_many(invites, None)
|
.insert_many(invites, None)
|
||||||
@@ -1068,6 +1069,7 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
|||||||
.await
|
.await
|
||||||
.expect("failed to find invites");
|
.expect("failed to find invites");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Need to migrate fields on attachments, change `user_id`, `object_id`, etc to `parent`.
|
// Need to migrate fields on attachments, change `user_id`, `object_id`, etc to `parent`.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user