Switch to async Rust and break all logic.

This commit is contained in:
Paul Makles
2020-12-27 13:28:37 +00:00
parent 5711986768
commit 6cfec0ee08
26 changed files with 1141 additions and 1256 deletions

View File

@@ -3,16 +3,17 @@ use super::get_connection;
pub mod init;
pub mod scripts;
pub fn run_migrations() {
pub async fn run_migrations() {
let client = get_connection();
let list = client
.list_database_names(None, None)
.await
.expect("Failed to fetch database names.");
if list.iter().position(|x| x == "revolt").is_none() {
init::create_database();
init::create_database().await;
} else {
scripts::migrate_database();
scripts::migrate_database().await;
}
}