Logging + database migrations system.

This commit is contained in:
Paul Makles
2020-08-11 21:08:01 +02:00
parent 750f8c6738
commit a8eb403280
9 changed files with 157 additions and 12 deletions

View File

@@ -10,13 +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();
migrations::run_migrations();
}
pub fn get_connection() -> &'static Client {
@@ -31,6 +26,8 @@ pub fn get_collection(collection: &str) -> Collection {
get_db().collection(collection)
}
pub mod migrations;
pub mod channel;
pub mod guild;
pub mod message;