Update to mongo 1.1.0-beta, start reset + migrations

This commit is contained in:
Paul Makles
2020-08-04 10:04:08 +02:00
parent 6a1912c27b
commit 17c9148556
18 changed files with 1367 additions and 1125 deletions

View File

@@ -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();
}