4525 upgrade pg graphql (#4646)

* TO remove: add multiple workspace with command

* TO remove: update build script

* Update script and add doc

* TO remove: add more seed workspaces

* Build pg_graphql files for 1.5.1

* Build pg_graphql files for 1.5.1 macos arm

* Remove 600 seed workspaces

* Build pg_graphql files for 1.5.1 macos intel
This commit is contained in:
martmull
2024-03-25 15:08:17 +01:00
committed by GitHub
parent e576fe0d67
commit e2af5b8628
21 changed files with 539 additions and 16 deletions

View File

@ -48,15 +48,15 @@ EOF
echo_header $BLUE " DATABASE SETUP"
PG_MAIN_VERSION=15
PG_GRAPHQL_VERSION=1.4.2
CARGO_PGRX_VERSION=0.10.2
PG_GRAPHQL_VERSION=1.5.1
CARGO_PGRX_VERSION=0.11.2
TARGETARCH=$(dpkg --print-architecture)
# Install PostgresSQL
echo_header $GREEN "Step [1/4]: Installing PostgreSQL..."
apt update -y || handle_error "Failed to update package list."
apt install -y postgresql-$PG_MAIN_VERSION postgresql-contrib || handle_error "Failed to install PostgreSQL."su
apt install -y curl || handle_error "Failed to install curl."
apt install -y sudo || handle_error "Failed to install sudo."
apt install build-essential -y || handle_error "Failed to install build-essential."
apt install pkg-config -y || handle_error "Failed to install pkg-config."
apt install libssl-dev -y || handle_error "Failed to install libssl-dev."
@ -77,9 +77,9 @@ fi
# To force a reinstall of cargo-pgrx, pass --force to the command below
curl https://sh.rustup.rs -sSf | sh
source "$HOME/.cargo/env"
cargo install --locked cargo-pgrx@$CARGO_PGRX_VERSION --force
cargo pgrx init --pg$PG_MAIN_VERSION download
source "$HOME/.cargo/env" || . "$HOME/.cargo/env"
cargo install --locked cargo-pgrx@$CARGO_PGRX_VERSION --force || handle_error "Failed to install cargo"
cargo pgrx init --pg$PG_MAIN_VERSION download || handle_error "Failed to init postgresql"
# Create a temporary directory
temp_dir=$(mktemp -d)
@ -93,12 +93,13 @@ cd "pg_graphql-$PG_GRAPHQL_VERSION"
# Apply patches to pg_graphql files
echo "Applying patches to pg_graphql files..."
for patch_file in "/patches/pg_graphql/"*.patch; do
for patch_file in "/twenty/patches/pg_graphql/"*.patch; do
echo "Applying patch: $patch_file"
patch -p1 < "$patch_file"
done
cargo pgrx install --release --pg-config /opt/bitnami/postgresql/bin/pg_config
echo_header $GREEN "Step [2/4]: Building PostgreSQL service..."
cargo pgrx install --release --pg-config /opt/bitnami/postgresql/bin/pg_config || handle_error "Failed to build postgresql"
# Clean up the temporary directory