From 7d027ec5e85a797cb71c8cef7b5105d49e813b23 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Mon, 24 Feb 2025 11:41:52 -0600 Subject: [PATCH] Search for sql upgrade scripts relative to the package manifest (#1979) Take ParadeDB[0] as an example. Their repository is a Cargo workspace with the Postgres extension located in the pg_search directory. Say you were to run `cargo pgrx install --package pg_search` from the root of the ParadeDB repository. cargo-pgrx would look for sql upgrade scripts relative to the current working directory instead of within the specified package directory. Link: https://github.com/paradedb/paradedb [0] Signed-off-by: Tristan Partin --- cargo-pgrx/src/command/install.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo-pgrx/src/command/install.rs b/cargo-pgrx/src/command/install.rs index 31c9b436a..f8077ba51 100644 --- a/cargo-pgrx/src/command/install.rs +++ b/cargo-pgrx/src/command/install.rs @@ -386,7 +386,7 @@ fn copy_sql_files( )?; // now copy all the version upgrade files too - if let Ok(dir) = fs::read_dir("sql/") { + if let Ok(dir) = fs::read_dir(package_manifest_path.as_ref().parent().unwrap().join("sql/")) { for sql in dir.flatten() { let filename = sql.file_name().into_string().unwrap();