forked from jmug/stoatchat
@@ -11,7 +11,7 @@ struct MigrationInfo {
|
||||
revision: i32,
|
||||
}
|
||||
|
||||
pub const LATEST_REVISION: i32 = 7;
|
||||
pub const LATEST_REVISION: i32 = 8;
|
||||
|
||||
pub async fn migrate_database() {
|
||||
let migrations = get_collection("migrations");
|
||||
@@ -203,6 +203,15 @@ pub async fn run_migrations(revision: i32) -> i32 {
|
||||
.expect("Failed to create message index.");
|
||||
}
|
||||
|
||||
if revision <= 7 {
|
||||
info!("Running migration [revision 7 / 2021-08-11]: Add message text index.");
|
||||
|
||||
get_db()
|
||||
.create_collection("bots", None)
|
||||
.await
|
||||
.expect("Failed to create bots collection.");
|
||||
}
|
||||
|
||||
// Reminder to update LATEST_REVISION when adding new migrations.
|
||||
LATEST_REVISION
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user