Compare commits
No commits in common. "6f24d9221585e8cf7869b15225b0e611249365c6" and "85f16311fa440e3ad4be343978c86e79ceed856f" have entirely different histories.
6f24d92215
...
85f16311fa
@ -122,12 +122,6 @@ impl DB {
|
||||
}
|
||||
|
||||
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;
|
||||
db.collection::<AnyCollection>("events")
|
||||
.drop_indexes()
|
||||
.await?;
|
||||
let events = self.get_database().await.collection::<Event>("events");
|
||||
events
|
||||
.create_index(
|
||||
@ -138,15 +132,12 @@ impl DB {
|
||||
)
|
||||
.await?;
|
||||
|
||||
db.collection::<AnyCollection>("events")
|
||||
.drop_indexes()
|
||||
.await?;
|
||||
// clear callbacks after a day because otherwise database will contain so much data
|
||||
// for just button clicks
|
||||
let callback_info = self
|
||||
.get_database()
|
||||
.await
|
||||
.collection::<AnyCollection>("callback_info");
|
||||
.collection::<Event>("callback_info");
|
||||
callback_info
|
||||
.create_index(
|
||||
IndexModel::builder()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user