create AnyCollection type in migration

reason: most of it doesn't need real type,
but will simplificate alot without real ones
This commit is contained in:
Akulij 2025-04-30 18:07:07 +03:00
parent 85f16311fa
commit 4d6717967d

View File

@ -122,6 +122,9 @@ impl DB {
} }
pub async fn migrate(&mut self) -> DbResult<()> { pub async fn migrate(&mut self) -> DbResult<()> {
let db = self.get_database().await;
/// some migrations doesn't realy need type of collection
type AnyCollection = Event;
let events = self.get_database().await.collection::<Event>("events"); let events = self.get_database().await.collection::<Event>("events");
events events
.create_index( .create_index(
@ -137,7 +140,7 @@ impl DB {
let callback_info = self let callback_info = self
.get_database() .get_database()
.await .await
.collection::<Event>("callback_info"); .collection::<AnyCollection>("callback_info");
callback_info callback_info
.create_index( .create_index(
IndexModel::builder() IndexModel::builder()