drop all previous indexes in migration
This commit is contained in:
parent
4d6717967d
commit
6f24d92215
@ -125,6 +125,9 @@ impl DB {
|
|||||||
let db = self.get_database().await;
|
let db = self.get_database().await;
|
||||||
/// some migrations doesn't realy need type of collection
|
/// some migrations doesn't realy need type of collection
|
||||||
type AnyCollection = Event;
|
type AnyCollection = Event;
|
||||||
|
db.collection::<AnyCollection>("events")
|
||||||
|
.drop_indexes()
|
||||||
|
.await?;
|
||||||
let events = self.get_database().await.collection::<Event>("events");
|
let events = self.get_database().await.collection::<Event>("events");
|
||||||
events
|
events
|
||||||
.create_index(
|
.create_index(
|
||||||
@ -135,6 +138,9 @@ impl DB {
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
db.collection::<AnyCollection>("events")
|
||||||
|
.drop_indexes()
|
||||||
|
.await?;
|
||||||
// clear callbacks after a day because otherwise database will contain so much data
|
// clear callbacks after a day because otherwise database will contain so much data
|
||||||
// for just button clicks
|
// for just button clicks
|
||||||
let callback_info = self
|
let callback_info = self
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user