diff --git a/README.md b/README.md index 9f23f0f8..352a3ab3 100644 --- a/README.md +++ b/README.md @@ -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` | diff --git a/assets/runtime/config/gitlabhq/database.yml b/assets/runtime/config/gitlabhq/database.yml index 018d28a3..9cfd8037 100644 --- a/assets/runtime/config/gitlabhq/database.yml +++ b/assets/runtime/config/gitlabhq/database.yml @@ -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}} diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index b7772e05..13396e7d 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -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:-} diff --git a/assets/runtime/functions b/assets/runtime/functions index 7d4a647f..2b2e51df 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -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 \