mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
feat: enable migrations
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user