mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
Switch to async Rust and break all logic.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user