Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix docker build db migration by granting missing permissions

Markus Kahl5dfcaeaa44c1
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:[email protected]/structure RAILS_ENV=production bundle exec rake db:migrate db:schema:dump db:schema:cache:dump