forked from jmug/stoatchat
Update to mongo 1.1.0-beta, start reset + migrations
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use mongodb::{Client, Collection, Database};
|
||||
use mongodb::sync::{Client, Collection, Database};
|
||||
use mongodb::bson::doc;
|
||||
use std::env;
|
||||
|
||||
use once_cell::sync::OnceCell;
|
||||
@@ -9,6 +10,8 @@ pub fn connect() {
|
||||
Client::with_uri_str(&env::var("DB_URI").expect("DB_URI not in environment variables!"))
|
||||
.expect("Failed to init db connection.");
|
||||
|
||||
client.database("revolt").collection("migrations").find(doc! { }, None).expect("Failed to get migration data from database.");
|
||||
|
||||
DBCONN.set(client).unwrap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user