Expose DB_COLLATION parameter

This commit is contained in:
Peter Leitzen 2017-06-04 19:56:50 +02:00
parent 91aaea234e
commit ad68271db1
4 changed files with 6 additions and 1 deletions

View File

@ -905,6 +905,7 @@ Below is the complete list of available options that can be used to customize yo
| `SIDEKIQ_MEMORY_KILLER_MAX_RSS` | Non-zero value enables the SidekiqMemoryKiller. Defaults to `1000000`. For additional options refer [Configuring the MemoryKiller](http://doc.gitlab.com/ce/operations/sidekiq_memory_killer.html) |
| `DB_ADAPTER` | The database type. Possible values: `mysql2`, `postgresql`. Defaults to `postgresql`. |
| `DB_ENCODING` | The database encoding. For `DB_ADAPTER` values `postresql` and `mysql2`, this parameter defaults to `unicode` and `utf8` respectively. |
| `DB_COLLATION` | The database collation. Defaults to `utf8_general_ci` for `DB_ADAPTER` `mysql2`. This parameter is not supported for `DB_ADAPTER` `postresql` and will be removed. |
| `DB_HOST` | The database server hostname. Defaults to `localhost`. |
| `DB_PORT` | The database server port. Defaults to `3306` for mysql and `5432` for postgresql. |
| `DB_NAME` | The database database name. Defaults to `gitlabhq_production` |

View File

@ -4,7 +4,7 @@
production:
adapter: {{DB_ADAPTER}}
encoding: {{DB_ENCODING}}
collation: utf8_general_ci
collation: {{DB_COLLATION}}
reconnect: false
database: {{DB_NAME}}
host: {{DB_HOST}}

View File

@ -34,6 +34,7 @@ NGINX_HSTS_MAXAGE=${NGINX_HSTS_MAXAGE:-31536000}
## DATABASE
DB_ADAPTER=${DB_ADAPTER:-}
DB_ENCODING=${DB_ENCODING:-}
DB_COLLATION=${DB_COLLATION:-}
DB_HOST=${DB_HOST:-}
DB_PORT=${DB_PORT:-}
DB_NAME=${DB_NAME:-}

View File

@ -150,10 +150,12 @@ gitlab_finalize_database_parameters() {
case ${DB_ADAPTER} in
mysql2)
DB_ENCODING=${DB_ENCODING:-utf8}
DB_COLLATION=${DB_COLLATION:-utf8_general_ci}
DB_PORT=${DB_PORT:-3306}
;;
postgresql)
DB_ENCODING=${DB_ENCODING:-unicode}
# DB_COLLATION: Not supported for postgresql and will be removed below.
DB_PORT=${DB_PORT:-5432}
;;
*)
@ -205,6 +207,7 @@ gitlab_configure_database() {
update_template ${GITLAB_DATABASE_CONFIG} \
DB_ADAPTER \
DB_ENCODING \
DB_COLLATION \
DB_HOST \
DB_PORT \
DB_NAME \