]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/utils.rs
Speeding up comment-ltree migration, fixing index creation. Fixes #2664 (#2670)
[lemmy.git] / crates / db_schema / src / utils.rs
index f6accb60c29f483a24f5f58a2e49ae726a390729..cf96b5e77f2f322783b2950eafc8905db9adcb4f 100644 (file)
@@ -26,6 +26,7 @@ use lemmy_utils::{error::LemmyError, settings::structs::Settings};
 use once_cell::sync::Lazy;
 use regex::Regex;
 use std::{env, env::VarError};
+use tracing::info;
 use url::Url;
 
 const FETCH_LIMIT_DEFAULT: i64 = 10;
@@ -154,9 +155,11 @@ pub fn run_migrations(db_url: &str) {
   // Needs to be a sync connection
   let mut conn =
     PgConnection::establish(db_url).unwrap_or_else(|_| panic!("Error connecting to {}", db_url));
+  info!("Running Database migrations (This may take a long time)...");
   let _ = &mut conn
     .run_pending_migrations(MIGRATIONS)
     .unwrap_or_else(|_| panic!("Couldn't run DB Migrations"));
+  info!("Database migrations complete.");
 }
 
 pub async fn build_db_pool(settings: &Settings) -> Result<DbPool, LemmyError> {