57 lines
2.1 KiB
Diff
57 lines
2.1 KiB
Diff
|
diff --git a/crates/db_schema/src/utils.rs b/crates/db_schema/src/utils.rs
|
||
|
index acedab97..4b62b5bb 100644
|
||
|
--- a/crates/db_schema/src/utils.rs
|
||
|
+++ b/crates/db_schema/src/utils.rs
|
||
|
@@ -134,9 +134,12 @@ pub fn diesel_option_overwrite_to_url_create(
|
||
|
}
|
||
|
|
||
|
async fn build_db_pool_settings_opt(settings: Option<&Settings>) -> Result<DbPool, LemmyError> {
|
||
|
+ println!("build_db_pool_settings_opt");
|
||
|
let db_url = get_database_url(settings);
|
||
|
+ println!(" db_url: {db_url}");
|
||
|
let pool_size = settings.map(|s| s.database.pool_size).unwrap_or(5);
|
||
|
let manager = AsyncDieselConnectionManager::<AsyncPgConnection>::new(&db_url);
|
||
|
+ println!(" built manager");
|
||
|
let pool = Pool::builder(manager)
|
||
|
.max_size(pool_size)
|
||
|
.wait_timeout(POOL_TIMEOUT)
|
||
|
@@ -144,12 +147,15 @@ async fn build_db_pool_settings_opt(settings: Option<&Settings>) -> Result<DbPoo
|
||
|
.recycle_timeout(POOL_TIMEOUT)
|
||
|
.runtime(Runtime::Tokio1)
|
||
|
.build()?;
|
||
|
+ println!(" built pool");
|
||
|
|
||
|
// If there's no settings, that means its a unit test, and migrations need to be run
|
||
|
if settings.is_none() {
|
||
|
+ println!(" running migrations");
|
||
|
run_migrations(&db_url);
|
||
|
}
|
||
|
|
||
|
+ println!(" complete");
|
||
|
Ok(pool)
|
||
|
}
|
||
|
|
||
|
diff --git a/src/code_migrations.rs b/src/code_migrations.rs
|
||
|
index c69ce591..0914677d 100644
|
||
|
--- a/src/code_migrations.rs
|
||
|
+++ b/src/code_migrations.rs
|
||
|
@@ -40,7 +40,9 @@ use tracing::info;
|
||
|
use url::Url;
|
||
|
|
||
|
pub async fn run_advanced_migrations(pool: &DbPool, settings: &Settings) -> Result<(), LemmyError> {
|
||
|
+ println!("run_advanced_migrations");
|
||
|
let protocol_and_hostname = &settings.get_protocol_and_hostname();
|
||
|
+ println!(" conn: {protocol_and_hostname}");
|
||
|
user_updates_2020_04_02(pool, protocol_and_hostname).await?;
|
||
|
community_updates_2020_04_02(pool, protocol_and_hostname).await?;
|
||
|
post_updates_2020_04_03(pool, protocol_and_hostname).await?;
|
||
|
@@ -52,6 +54,8 @@ pub async fn run_advanced_migrations(pool: &DbPool, settings: &Settings) -> Resu
|
||
|
regenerate_public_keys_2022_07_05(pool).await?;
|
||
|
initialize_local_site_2022_10_10(pool, settings).await?;
|
||
|
|
||
|
+ println!(" complete");
|
||
|
+
|
||
|
Ok(())
|
||
|
}
|
||
|
|