From 6fc4b060bcf80dc770cd0d196e40d135a2d6a55b Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Mon, 20 Jan 2020 12:45:14 -0300 Subject: [PATCH] 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 Co-authored-by: Lunny Xiao --- doc/advanced/config-cheat-sheet.en-us.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index d63eaf8e..1c03fce3 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -209,6 +209,9 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `NAME`: **gitea**: Database name. - `USER`: **root**: Database username. - `PASSWD`: **\**: Database user password. Use \`your password\` for quoting if you use special characters in the password. +- `SCHEMA`: **\**: For PostgreSQL only, schema to use if different from "public". The schema must exist beforehand, + the user must have creation privileges on it, and the user search path must be set to the look into the schema first + (e.g. `ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;`). - `SSL_MODE`: **disable**: For PostgreSQL and MySQL only. - `CHARSET`: **utf8**: For MySQL only, either "utf8" or "utf8mb4", default is "utf8". NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this. - `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.