summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2020-01-20 12:45:14 -0300
committerAntoine GIRARD <sapk@users.noreply.github.com>2020-01-20 16:45:14 +0100
commitad1b6d439fe0e0875e54227e0bc23a74411f490e (patch)
tree8e16e25a913d167ebb772ad2e0e92cbba9c56b66 /templates
parent6d6f1d568ec36786b1020f4b43cbd872228c6633 (diff)
downloadgitea-ad1b6d439fe0e0875e54227e0bc23a74411f490e.tar.gz
gitea-ad1b6d439fe0e0875e54227e0bc23a74411f490e.zip
Add support for database schema in PostgreSQL (#8819)
* Add support for database schema * Require setting search_path for the db user * Add schema setting to admin/config.tmpl * Use a schema different from default for psql tests * Update postgres scripts to use custom schema * Update to xorm/core 0.7.3 and xorm/xorm c37aff9b3a * Fix migration test Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl2
-rw-r--r--templates/install.tmpl5
2 files changed, 7 insertions, 0 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index c2793ece9d..c6a23cd367 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -128,6 +128,8 @@
<dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd>
{{end}}
{{if eq .DbCfg.Type "postgres"}}
+ <dt>{{.i18n.Tr "admin.config.db_schema"}}</dt>
+ <dd>{{if .DbCfg.Schema}}{{.DbCfg.Schema}}{{else}}-{{end}}</dd>
<dt>{{.i18n.Tr "admin.config.db_ssl_mode"}}</dt>
<dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd>
{{end}}
diff --git a/templates/install.tmpl b/templates/install.tmpl
index f8d1ef04e4..7f7c754bbf 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -62,6 +62,11 @@
</div>
</div>
</div>
+ <div class="inline field {{if .Err_DbSetting}}error{{end}}">
+ <label for="db_schema">{{.i18n.Tr "install.db_schema"}}</label>
+ <input id="db_schema" name="db_schema" value="{{.db_schema}}">
+ <span class="help">{{.i18n.Tr "install.db_schema_helper"}}</span>
+ </div>
</div>
<div id="mysql_settings" class="{{if not (eq .CurDbOption "MySQL")}}hide{{end}}">