From 5dfcaeaa44c170aba106dbcf1a2e63598706e5d7 Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Fri, 20 Jun 2025 15:52:46 +0100 Subject: [PATCH] fix docker build db migration by granting missing permissions --- docker/prod/setup/postinstall-onprem.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/prod/setup/postinstall-onprem.sh b/docker/prod/setup/postinstall-onprem.sh index 5c167b1862a..72ee90b7dab 100755 --- a/docker/prod/setup/postinstall-onprem.sh +++ b/docker/prod/setup/postinstall-onprem.sh @@ -45,6 +45,8 @@ su - postgres -c "$PGBIN/pg_ctl -D /tmp/nulldb -l /dev/null -l /tmp/nulldb/log - sleep 5 echo "create database structure; create user structure with encrypted password 'p4ssw0rd'; grant all privileges on database structure to structure;" | su - postgres -c psql +# since postgres 15 we need to also explictly grant the user permissions on the public schema +echo "grant all on schema public to structure;" | su - postgres -c 'psql -d structure' # dump schema DATABASE_URL=postgres://structure:p4ssw0rd@127.0.0.1/structure RAILS_ENV=production bundle exec rake db:migrate db:schema:dump db:schema:cache:dump