lemmy-server: remove useless override
This commit is contained in:
parent
49e33d7238
commit
9b53a28920
|
@ -107,8 +107,6 @@ let
|
|||
|
||||
komikku = callPackage ./patched/komikku { inherit (unpatched) komikku; };
|
||||
|
||||
lemmy-server = callPackage ./patched/lemmy-server { inherit (unpatched) lemmy-server; };
|
||||
|
||||
phoc = callPackage ./patched/phoc { inherit (unpatched) phoc; };
|
||||
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
diff --git a/src/code_migrations.rs b/src/code_migrations.rs
|
||||
index c69ce591..b416a299 100644
|
||||
--- a/src/code_migrations.rs
|
||||
+++ b/src/code_migrations.rs
|
||||
@@ -36,7 +36,7 @@ use lemmy_db_schema::{
|
||||
utils::{get_conn, naive_now, DbPool},
|
||||
};
|
||||
use lemmy_utils::{error::LemmyError, settings::structs::Settings};
|
||||
-use tracing::info;
|
||||
+use tracing::{debug, info};
|
||||
use url::Url;
|
||||
|
||||
pub async fn run_advanced_migrations(pool: &DbPool, settings: &Settings) -> Result<(), LemmyError> {
|
||||
@@ -419,7 +419,9 @@ async fn initialize_local_site_2022_10_10(
|
||||
info!("Running initialize_local_site_2022_10_10");
|
||||
|
||||
// Check to see if local_site exists
|
||||
- if LocalSite::read(pool).await.is_ok() {
|
||||
+ let local_site = LocalSite::read(pool).await;
|
||||
+ debug!("local_site: {local_site:?}");
|
||||
+ if local_site.is_ok() {
|
||||
return Ok(());
|
||||
}
|
||||
info!("No Local Site found, creating it.");
|
|
@ -1,12 +0,0 @@
|
|||
{ lemmy-server }:
|
||||
|
||||
lemmy-server.overrideAttrs (upstream: {
|
||||
patches = upstream.patches or [] ++ [
|
||||
# "thread 'main' panicked at 'Couldn't run DB Migrations: Failed to run 2022-07-07-182650_comment_ltrees with: permission denied: "RI_ConstraintTrigger_a_647340" is a system trigger', crates/db_schema/src/utils.rs:165:25"
|
||||
# ./fix-db-migrations.patch #< upstreamed as of 2023/06/28
|
||||
# log the database connection events, for debugging
|
||||
# ./log-startup.patch
|
||||
# print more debug info about specific problem paths i've encountered
|
||||
# ./debug-db-migrations.patch
|
||||
];
|
||||
})
|
|
@ -1,19 +0,0 @@
|
|||
diff --git a/migrations/2022-07-07-182650_comment_ltrees/up.sql b/migrations/2022-07-07-182650_comment_ltrees/up.sql
|
||||
index fde9e1b3..55b96dac 100644
|
||||
--- a/migrations/2022-07-07-182650_comment_ltrees/up.sql
|
||||
+++ b/migrations/2022-07-07-182650_comment_ltrees/up.sql
|
||||
@@ -60,7 +60,7 @@ ORDER BY
|
||||
breadcrumb;
|
||||
|
||||
-- Remove indexes and foreign key constraints, and disable triggers for faster updates
|
||||
-alter table comment disable trigger all;
|
||||
+-- alter table comment disable trigger all;
|
||||
|
||||
alter table comment drop constraint if exists comment_creator_id_fkey;
|
||||
alter table comment drop constraint if exists comment_parent_id_fkey;
|
||||
@@ -115,4 +115,4 @@ create index idx_path_gist on comment using gist (path);
|
||||
-- Drop the parent_id column
|
||||
alter table comment drop column parent_id cascade;
|
||||
|
||||
-alter table comment enable trigger all;
|
||||
+-- alter table comment enable trigger all;
|
|
@ -1,56 +0,0 @@
|
|||
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(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user