feat: enable migrations

This commit is contained in:
Paul Makles
2022-02-11 12:37:09 +00:00
parent 249b1161f9
commit 5aee381fd6
2 changed files with 14 additions and 11 deletions

View File

@@ -121,12 +121,15 @@ async fn launch_web() {
};
}
let db = DatabaseInfo::Dummy.connect().await.unwrap();
let db = DatabaseInfo::MongoDb("mongodb://localhost").connect().await.unwrap();
db.migrate_database().await.unwrap();
let mongo_db = mongodb::Client::with_uri_str("mongodb://localhost")
.await
.expect("Failed to init db connection.");
rauth::entities::sync_models(&mongo_db.database("revolt")).await;
let auth = Auth::new(mongo_db.database("revolt"), config);
let rocket = rocket::build();
routes::mount(rocket)