From 3df7d82b83610a9418b3638baef8ff86453e613a Mon Sep 17 00:00:00 2001
From: Mirco Nasuti <mirco.nasuti@chuv.ch>
Date: Thu, 22 Sep 2016 09:29:35 +0200
Subject: [PATCH] add env vars to configure DB schemas

---
 docker/runner/README.md               | 3 +++
 docker/runner/config/application.tmpl | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/docker/runner/README.md b/docker/runner/README.md
index b810ed96a..a210c04c5 100644
--- a/docker/runner/README.md
+++ b/docker/runner/README.md
@@ -10,16 +10,19 @@ You need to configure a few things using some environment variables.
 Environment variables:
 
 * PORTAL_DB_URL: JDBC URL to connect to the portal database, for example "jdbc:postgresql://db:5432/portal"
+* PORTAL_DB_SCHEMA: Database schema, default value is "public"
 * PORTAL_DB_SERVER: optional, address of the portal database server, for example DB_SERVER="db:5432". Used to wait for the database to be up and running.
 * PORTAL_DB_USER: User to use when connecting to the portal database
 * PORTAL_DB_PASSWORD: Password to use when connecting to the portal database
 
 * META_DB_URL: JDBC URL to connect to the metadata database
+* META_DB_SCHEMA: Database schema, default value is "public"
 * META_DB_SERVER: optional, address of the metadata database server. Used to wait for the database to be up and running.
 * META_DB_USER: User to use when connecting to the metadata database
 * META_DB_PASSWORD: Password to use when connecting to the metadata database
 
 * SCIENCE_DB_URL: JDBC URL to connect to the science database
+* SCIENCE_DB_SCHEMA: Database schema, default value is "public"
 * SCIENCE_DB_SERVER: optional, address of the science database server. Used to wait for the database to be up and running.
 * SCIENCE_DB_USER: User to use when connecting to the science database
 * SCIENCE_DB_PASSWORD: Password to use when connecting to the science database
diff --git a/docker/runner/config/application.tmpl b/docker/runner/config/application.tmpl
index c3e6883f6..2c4b7da57 100644
--- a/docker/runner/config/application.tmpl
+++ b/docker/runner/config/application.tmpl
@@ -4,16 +4,19 @@
 spring:
   portalDatasource:
     url: {{ default .Env.PORTAL_DB_URL "jdbc:postgresql://172.22.0.1:5432/portal" }}
+    schema: {{ default .Env.PORTAL_DB_SCHEMA "public" }}
     username: {{ default .Env.PORTAL_DB_USER "postgres" }}
     password: {{ .Env.PORTAL_DB_PASSWORD }}
     driver-class-name: org.postgresql.Driver
   metaDatasource:
     url: {{ default .Env.META_DB_URL "jdbc:postgresql://172.22.0.1:5432/meta" }}
+    schema: {{ default .Env.META_DB_SCHEMA "public" }}
     username: {{ default .Env.META_DB_USER "postgres" }}
     password: {{ .Env.META_DB_PASSWORD }}
     driver-class-name: org.postgresql.Driver
   scienceDatasource:
       url: {{ default .Env.SCIENCE_DB_URL "jdbc:postgresql://172.22.0.1:5433/science" }}
+      schema: {{ default .Env.SCIENCE_DB_SCHEMA "public" }}
       username: {{ default .Env.SCIENCE_DB_USER "postgres" }}
       password: {{ .Env.SCIENCE_DB_PASSWORD }}
       driver-class-name: org.postgresql.Driver
-- 
GitLab