From: Lucas Di Pentima Date: Thu, 9 Nov 2023 19:10:19 +0000 (-0300) Subject: 21031: Fixes post installation script for rails applications. X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/d6e41e6884090f5ff42e9fa5bb53852c7bcc47c4?hp=03caa5fccf60f32c4fe1d6aac297c64ade6a69b9 21031: Fixes post installation script for rails applications. Set up schema files ownership in the same way without regards on the rake task used: db:schema:load or db:structure:load (deprecated). Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/build/rails-package-scripts/postinst.sh b/build/rails-package-scripts/postinst.sh index f6ae48c0fc..e317f85aaf 100644 --- a/build/rails-package-scripts/postinst.sh +++ b/build/rails-package-scripts/postinst.sh @@ -218,8 +218,11 @@ configure_version() { # Make sure postgres doesn't try to use a pager. export PAGER= case "$RAILSPKG_DATABASE_LOAD_TASK" in - db:schema:load) chown "$WWW_OWNER:" $RELEASE_PATH/db/schema.rb ;; - db:structure:load) chown "$WWW_OWNER:" $RELEASE_PATH/db/structure.sql ;; + # db:structure:load was deprecated in Rails 6.1 and shouldn't be used. + db:schema:load | db:structure:load) + chown "$WWW_OWNER:" $RELEASE_PATH/db/schema.rb || true + chown "$WWW_OWNER:" $RELEASE_PATH/db/structure.sql || true + ;; esac chmod 644 $SHARED_PATH/log/* chmod -R 2775 $RELEASE_PATH/tmp || true