Skip to content

Commit

Permalink
Search for sql upgrade scripts relative to the package manifest (#1979)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tristan957 authored Feb 24, 2025
1 parent 2efe07b commit 7d027ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 7d027ec

Please sign in to comment.